Chapter 40

Mapping with MapView and MapActivity

One of Google’s most popular services—after Search, of course—is Google Maps, which enables you to map everything from the location of the nearest pizza parlor to directions from New York City to San Francisco (only 2571 miles, or 4135 kilometers for the metric-inclined), and includes street views and satellite imagery.

Most Android devices, not surprisingly, integrate Google Maps. For those that do, there is a mapping activity available to users straight from the main Android launcher. More relevant to you, as a developer, are MapView and MapActivity, which allow you to integrate maps into your own applications. Not only can you display maps, control the zoom level, and allow people to pan around, ...

Get Beginning Android 4 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.