Jun 16, 2011

MapView and Maps API Key

The MapView class in the Maps external library is a very useful class that lets you easily integrate Google Maps into your application. It provides built-in map downloading, rendering, and caching of Maps tiles, as well as a variety of display options and controls. It provides a wrapper around the Google Maps API that lets your application request and manipulate Google Maps data through class methods, and it lets you work with Maps data as you would other types of Views.

Because MapView gives you access to Google Maps data, you need to register with the Google Maps service and agree to the applicable Terms of Service before your MapView will be able to obtain data from Google Maps. This will apply whether you are developing your application on the emulator or preparing your application for deployment to mobile devices.

Registering for a Maps API Key is simple, free, and has two parts:

- Registering the MD5 fingerprint of the certificate that you will use to sign your application. The Maps registration service then provides you a Maps API Key that is associated with your application's signer certificate.

- Adding a reference to the Maps API Key in each MapView, whether declared in XML or instantiated directly from code. You can use the same Maps API Key for any MapView in any Android application, provided that the application is signed with the certificate whose fingerprint you registered with the service.

Google document, Obtaining a Maps API Key, have instructions on how to obtain and use your Maps API Key:
  • Overview
  • Getting the MD5 Fingerprint of Your Signing Certificate

  • Getting the MD5 Fingerprint of the SDK Debug Certificate
  • Registering the Certificate Fingerprint with the Google Maps Service
  • Adding the Maps API Key to your Application
  • Final Steps to Enable MapView Elements

Related Post:
- MapView and MapActivity

1 comment:

Infolinks In Text Ads