This project will give you a chance to practice the skills you learned in the first lesson of the Android 101 course. Follow the instructions below:
After completing this project, please fill out the survey found here
- Create a new Android Studio project
- Name the project "Rainbow"
- Make sure that the target API level is below that of your testing environment.
- Open the app's activity_main.xml file.
- Change the parent viewgroup to a linear layout
- Add six buttons to the main screen
- Each button's text attribute should be the name of a different color
- Create a listener and event handler for each button in MainActivity.java
- In each event handler, change the view's background color to the color that corresponds to the button's title
use
.setBackgroundColor(Color.RED)
to set the background color of your component.
Remember to useColor.color_name
to get access to the colors provided by android. You can see which colors are available in the documentation.
- Build and run your app using the your preferred test environment.
- Test each button to make sure that it changes the background color appropriately.
- Remember to use logs and the debugger when you run into issues.
If everything works, congratulations! You've just built your first Android app on your own from scratch!
Send your completed app to your Project Manager.
Experiment with different properties of Button and Linear Layout. To improve the look of your app.