O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying Your Contacts’ Locations

Now that you can find your device’s location and display the real-time location on the map, it’s time to show your contacts’ locations on the map. The map can be accessed from any of the three other activities through the navigation bar. If the user accesses the map from either the contact list or the settings activities, the map should display all the contacts in the database on the map. If the user accesses the map from the contact activity, the map should display only that contact. Implementing the second display type requires coding the ContactActivity to pass the current contact’s ID to the map.

Open ContactActivity.java and locate the initMapButton method. This method is modified to pass the contact’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required