Maps

Maps are implemented using the GoogleMap object in the source code file and a MapFragment in the layout file. These objects are not a part of the standard Android SDK but rather the Google Play Services SDK. This SDK must be installed on your development machine to implement maps in your app. Using Google Maps requires an API key. This key associates your app with an attempt to access the GoogleMap API. This is how you, and Google, can track how often your users access the map portion of your app. The API key is free. Maps are implemented as a MapFragment widget in a layout. The Activity that implements the code to provide the map’s behavior must be a FragmentActivity.

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android 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.