Understanding the Location Package

The android.location package provides facilities for location-based services. In this section, we are going to discuss two important pieces of this package: the Geocoder class and the LocationManager service. We'll start with Geocoder.

Geocoding with Android

If you are going to do anything practical with maps, you'll likely have to convert an address (or location) to a latitude/longitude pair. This concept is known as geocoding, and the android.location.Geocoder class provides this facility. In fact, the Geocoder class provides both forward and backward conversion—it can take an address and return a latitude/longitude pair, and it can translate a latitude/longitude pair into a list of addresses. The class provides ...

Get Pro Android 4 now with O’Reilly online learning.

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