Exercises

1. Modify the toolbar of the ContactActivity to display the proximity sensor readings. Add the proximity sensor service so that this works.

2. Modify the app so that when the user long-clicks the cell number of a contact, the text messaging service is opened instead of the phone service. You will have to have a permission in the manifest to send text (SMS) messages.

3. Modify the app to display an incoming text message as a Toast. You will have to register your app with a permission to read text (SMS) messages and set up a listener for text messages.

4. Modify the compass to report NW, NE, SE, and so on in addition to the N, W, S, and E headings.

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.