This course will be retired on July 14, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Accessing Views in Code: Declaring Variables 5:20
- Accessing Views in Code: Assigning Variables 6:24
- Initializing a Button 1 objective
- Making a Button Do Something 4:35
- Adding the OnClick Method 2:36
- Android Programming Basics 5 questions
- Generating a Random Number 4:08
- Choosing a Random Fact 4:52
- Using the Random Class 4 objectives
Well done!
You have completed Build a Simple Android App with Java!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
The heart of the logic behind our Fun Facts app is randomly selecting a fact. In this video we'll learn how to create and use objects of Java's Random class to generate a random number in a given range!
Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Lovejoy Mushunje
8,061 Points1 Answer
-
Linus Karlsson
7,402 Points2 Answers
-
PLUS
thays vieira
Courses Plus Student 265 Points1 Answer
-
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points1 Answer
-
Jisan Reza
8,089 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up