Chapter 8. Maps, Geocoding, and Location-Based Services


  • Forward and reverse geocoding

  • Creating interactive maps with Map Views and Map Activities

  • Creating and adding Overlays to maps

  • Finding your location with location-based services

  • Using proximity alerts

One of the defining features of mobile phones is their portability, so it's not surprising that some of the most enticing Android features are the services that let you find, contextualize, and map physical locations.

You can create map-based Activities using Google Maps as a user interface element. You have full access to the map, which enables you to control display settings, alter the zoom level, and pan the display. Using Overlays you can annotate maps and handle user input to provide map-contextualized information and functionality.

Also covered in this chapter are the location - based services (LBS), the services that let you find the device's current location. They include technologies like GPS and Google's cell-based location technology. You can specify which location-sensing technology to use explicitly by name, or implicitly by defining a set of criteria in terms of accuracy, cost, and other requirements.

Maps and location-based services use latitude and longitude to pinpoint geographic locations, but your users are more likely to think in terms of an address. Android provides a Geocoder that supports forward and reverse geocoding. Using the Geocoder you can convert back and forth between latitude/longitude ...

Get Professional Android™ 2 Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.