In this video, Doug Winnie introduces the ImageView widget and imports artwork into the project for the faces of the dice in the game. Using only XML, widgets can be created, modified and laid out using a variety of properties and other settings.
- [Narrator] In our app, we have simulated…the dice, we are rolling in our game,…with a random number generator.…But to make the game more interesting,…it would be great to show actual dice images…to make the game more real.…In Android, we can upload images…and display them in our app.…The widget we will use is Image View.…This time though, we're going to create them…entirely in code using XML tags…to position and load our images in the app.…First, we need to load our images.…I have six images that are the various…faces to the dice.…They are located in the exercise files…for this video in the Assets folder.…
These files need to be imported into our project.…In Android Studio, in the Project Panel,…look for the res folder.…Inside of this, you might have a folder called drawable.…In my case I don't.…The drawable folder is where we're going…to be adding our images.…I need to add the folder.…So I'm going to right click on res…and select New and then select Android resource directory.…This will allow us to add a new,…specific, Android resource directory…
- 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.