In this video, Doug Winnie walks through how to create an ArrayList out of ImageView widgets to start building code to make image assets dynamic in an Android app.
- [Narrator] With the ImageViews added to our project,…it's now time to link them into Java…and connect them to our random numbers created…by a random number generator.…Just like with our other widgets,…we need to create specific links…to connect them from the layout to Java.…Open the MainActivity.java file for this project…to get started.…We need to create two things.…The first are fields to link the ImageView widgets to Java.…The second is to create an array list…to group them together as a collection…so we can link through each one…when we create our random numbers.…
Since the collection needs to be scoped to the project,…we'll define the array list at the top of our class.…We're going to create a new comment, ArrayList…to hold all three dice images.…Then we'll create our ArrayList,…but this time instead of an integer…it's going to contain an ImageView.…And we'll call this diceImageViews.…We'll need to import the class again,…so go ahead and press ALT + Enter.…Now you can go into the onCreate method…and we can access the individual images.…
- Installing Android Studio
- Coding in Java and XML
- Getting a head start with starter templates
- Working with emulators
- Creating a project, variable, and toast
- Connecting XML widgets to code
- Adding images
- Adding game logic with conditional statements and operators
- Changing the data or design
Skill Level Beginner
1. Android Basics
Test your setup2m 56s
3. The Major Parts
4. Make an App
5. Tinkering with Your App
Next steps1m 4s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.