In this video, Doug Winnie adds a new TextView widget using code in XML to hold the score of the game. To make the text larger, you can use built-in styles to keep your text looking consistent throughout your app.
- [Narrator] The last major part of our project,…that we need to build is the scoring component.…You first need to create a new text view to…display the score in our app.…We can add this and display it…at the bottom of the app screen.…Open the Content, Main, X-M-L File in the project.…At the bottom of the file, after the last widget,…we'll create a new text view and we'll give…it the I-D of Score Text.…We'll start by adding in Text View.…Then we'll create an Android I-D.…
And we'll set this equal to at plus I-D slash score text.…You'll define the height and width based on the content.…We can use the Wrap Content setting to define these.…Android colon layout height, we'll set this equal…to Wrap Content with an underscore.…Then I'll set Android colon layout underscore width…and we'll also set this to Wrap Content.…We want to align this to the bottom of the parent container…and center it in the view.…
So we'll use Android colon layout align parent bottom…and then we'll set this to True.…Then Android colon layout underscore center horizontal…
- 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.