Advertisement
English transcript
Okay, so that last practice question actually came in two parts.
The first part was to go into activity_main.xml and change around
the code in a very similar way to how you were changing code in the browser.
The next part was to actually run this new app on your phone.
So I'm going to go ahead and do the first part.
I'll go over here, inside the res folder, layout folder,
and then I see activity_main.xml.
Double-click to open it up.
Okay, now I'm looking at a TextView child view
inside of a RelativeLayout parent.
Now it's the TextView that I'm interested in.
Okay, so I should ask myself am I changing something in
the RelativeLayout, in the TextView, or both?
And the answer is I'm changing something in the TextView.
Another question is which attribute or attributes do I need to change?
And to change around the text of the TextView,
that is the android:text attribute.
So I'm going to go right here.
I'm going to delete the current value but of course leave the quotes, and
then I'm going to type Happy Birthday Ben!
All right, cool.
So this point, I've done the first part of what I need to do,
which is change around the activity_main.xml file.
Now, I need to write it on my phone.
And that was a pretty simple process.
I go up to the top here and
over to the green play button which will install the app on my phone.
Now press play, wait about five seconds, and
at that point, this Choose Device window pops up.
As I just showed you, I'm going to select my phone,
and then I'm going to hit the OK button.
And it's a little bit hard to see, but Happy Birthday Ben appears on my phone.
The first part was to go into activity_main.xml and change around
the code in a very similar way to how you were changing code in the browser.
The next part was to actually run this new app on your phone.
So I'm going to go ahead and do the first part.
I'll go over here, inside the res folder, layout folder,
and then I see activity_main.xml.
Double-click to open it up.
Okay, now I'm looking at a TextView child view
inside of a RelativeLayout parent.
Now it's the TextView that I'm interested in.
Okay, so I should ask myself am I changing something in
the RelativeLayout, in the TextView, or both?
And the answer is I'm changing something in the TextView.
Another question is which attribute or attributes do I need to change?
And to change around the text of the TextView,
that is the android:text attribute.
So I'm going to go right here.
I'm going to delete the current value but of course leave the quotes, and
then I'm going to type Happy Birthday Ben!
All right, cool.
So this point, I've done the first part of what I need to do,
which is change around the activity_main.xml file.
Now, I need to write it on my phone.
And that was a pretty simple process.
I go up to the top here and
over to the green play button which will install the app on my phone.
Now press play, wait about five seconds, and
at that point, this Choose Device window pops up.
As I just showed you, I'm going to select my phone,
and then I'm going to hit the OK button.
And it's a little bit hard to see, but Happy Birthday Ben appears on my phone.