Exercises

1. Add the choice of a background color to the settings activity. Create a couple of new color resources in color.xml. Add these choices as a RadioGroup to the settings screen. You will have to modify the layout to place all the RadioGroups in a ScrollView so that you can see them all. Make the choice persist in a SharedPreferences object. Use the following command in the onCreate method of the settings activity to set the chosen background color:

scrollviewobject.setBackgroundResource(R.color.colorresourcename);

2. Create a method in ContactDataSource that will only update the Contact’s Address. Create a ContactAddress object to pass data to the method.

3. Modify the Contact table to include a field BFF ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.