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:
- 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
- MapView and MapActivity