Google Map Api Integration in Android Device
Hello Friend,
In this post i am providing the information how to integrate Google map API in own android Application.
API means Application programmer interface, it faciliate you to add some extra feature that provided by third party. just like in this example Map API provided by Google as a third party.
so , we have to take permission from google to use the Google map API.
Step 1.
Configuring Maps in Google Console
After getting SHA1 key we have to generate Google Map API Keyform API Console - Google follow bellow steps
Open browser and go to www.google.com => search API Console - Google this will show you following result:
Click first link of the search this will ask you to login with your gmail account
Create a new project:
Activate Google Map Android API v2
Now you Required Project Package Name and Your SHA-1 key
so for creation of SHA-1 KEY open command prompt then
navigate to following folderC:\Program Files\Java\jdk1.7.0_09\bin>
Then typekeytool.exe -list -v -alias androiddebugkey -keystore "C:\Documents and Settings\User\.android\debug.keystore" -storepass android -keypass android
Press Enter, It will generate SHA1 key copy it .Now You create and Android Project and copy the package name and both put on browser popup window in this way.
After that your Api key is created you can use this in your project.
Now you check it is google play service is install in you sdk manager or not if not then install it.
Then After you have to import googl map library in you work space by this way and add in your project.
Importing google_play_services_lib
After getting Google API Key we are back to Eclipse now we have to include google_play_services_lib in our project follow the steps
b. Click on Browse and select Google Play Services project from your android sdk folder. You can locate play services library project from
android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib
c. Importantly while importing check Copy projects into workspace option as shown in the below image.
After that Right Click on you project folder and navigate to Configure Build Path
Click on Add Class Folder
Select google_play_services_lib then ok
Click on Android after that click on Apply to save setting
Now you required a virtual or real device for testing application so to run application you have to create an AVD using for Google Api
Now for running application you choose it
Now google service library is added in your application.
No comments:
Post a Comment