Chapter 13

Maps, Geocoding, and Location-Based Services

What's in this Chapter?

Understanding 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 APIs are those that enable you to find, contextualize, and map physical locations.

Using the external Maps library included as part of the Google API package, 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 to different locations. Using Overlays you can annotate maps and handle user input.

This chapter also covers the location-based services (LBS) that enable you to find the device's current location. They include technologies such as GPS and cell- or Wi-Fi-based location-sensing techniques. You can specify which technology to use explicitly by name, or you can provide a set of Criteria in terms of accuracy, cost, and other requirements and let Android select the most appropriate.

Maps and location-based services use latitude and longitude to pinpoint geographic locations, but your users are more likely to think in terms of a street address. The maps library includes a geocoder that you can use to convert back and forth between ...

Get Professional Android 4 Application Development, 3rd Edition 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.