Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
The Problem1:12 with Ben Deitch
Use a Button and a TextView to create an app that counts up from zero!
Hey there, I'm Ben and I'm here to give you a little more practice with Android.
After all, practicing what you've learned is one of the best ways to make it stick.
In this practice session, we're going to practice creating a new project and
making a button respond to clicks.
If you're trying to implement something and it's just not working, a good way to
figure out what's wrong is to try and implement it in an empty project.
So what we are going to do for
this session is create an empty project and then build accounting app.
Here is what you need to do.
First, create a new project, naming it whatever you'd like, I've picked Counter.
Then, add a button and text view to the middle of the layout and
make the text view start with 0 as well as give the button a label of +1.
Also, set the size of the text in the text view to 24 sp.
Finally, once you've got your button in your text view, hook them up so
that when we tap on the button the text view increments by one, just like this.
All right now it's your turn, also if you get stuck or have any issues
there's some links to related videos in the teacher's notes below.
You need to sign up for Treehouse in order to download course files.Sign up