1. Generate certificate fingerprint:
①: Find the debug keystore path: Open Eclipse ---> Windows ---> Preferences ---> Android ---> Build, and the debug keystore path will be displayed in the Defualt debug keystore column
②: First configure the jdk environment (if not configured), open the cmd command window and locate to the bin directory of jdk.
keytool -list -v -keystore "debug keystore的目录" -alias androiddebugkey -storepass android -keypass android(输入keytool -list -alias androiddebugkey -keystore "debug keystore directory" -storepass android -keypass android will only generate MD5 ) . Press the Enter key and the following message will appear:
Second, generate Google Map API key
①: Open https://code.google.com/apis/console
②: Select Services on the right, find the Google Maps Android API, and then open (picture :)
③: Then select the API Access on the right, and then create a New Android Key, enter the SHA1 fingerprint in the text box, followed by a ";", and then the package name of your application; as follows:
④: There will be a key now. as follows:
Third, add the generated key to the application
①: Add in the <application> tag in AndroidManifest.xml
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="刚刚生成的key"/>
②: Continue to add the following elements
<permission android:name="com.example.googlemapdemo.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.googlemapdemo.permission.MAPS_RECEIVE"/>
Note: Replace com.example.googlemapdemo with the package name of your own application