Tuesday, 1 September 2015

Android Programming Tutorial 46 : GoogleMaps Guide In Android

Google Maps In Android


Integrating GoogleMaps in Android application to know location on the map, to know the specific place on the earth, different routes on the earth.

Step by Step to Integrate Google Maps in Android:

Step 1:

  Install relavent package to as shown below



Step 2:

Importing the google_play_services_lib in to your eclipse workspace like the below.

File>>New>>Import>>General>>Existing Project into Workspace>>Browse the location where you store the bundle>>E:\Softwares\Android Bundle\adt-bundle-windows-x86_64-20140702\sdk\extras\google\google_play_services\libproject and click on finish button.




The google_play_service will be imported into you eclipse.

Now add the google_play_service to our project like the below

Right click on the project and choose preferences and click on the Android from left side then click on the add option as the below figure.



After clickong on the add choose the google_play service and click on ok;


Now click on the apply option and ok.




Step 3:

Register you Project name into Google Console Api and generate the API KEY from google how to do that follow these steps.

Goto to google and type Google Console Api and select the first link like the below 


choose the create project and give the name over there has the below.



Once the projec created the it will open new widget, click on the API and auths options and again click on api option .
                                    

enable the Google API v2 Key as the below.




Now Click on the credentials option below the API and auth option it will open another window and choose Android Key option click on ok



Once you click on the Android Key option it will ask you enter package and SHA1 fingerprint as shown below , 



Package means the package of your eclipse Project and for SHA1 fingerprint.

In Eclipse choose window option>>preferences>>Android(left side)>>build option. once you click on the build option on the right side you will find the MD5 fingerprint and SHA1 Fingerprint in the Edit Text.

Copy the SHA1 fingerprint and past as the below.


OR



 click on the create option.




The Red circle is the API KEY.

Step 4:

To Generate SHA1 Fingerprint manually through Command Prompt follow the steps.

Open command prompt>>Start button>>Run>>type cmd.


now type the following keytool command in the cmd as the below

Run keytool using the following command:
keytool -list -v -keystore [STORE FILENAME] -alias [KEY NAME] -storepass [STORE PASSWORD] -keypass [KEY PASSWORD

Example:

keytool -list -v -keystore C:\Users\sunil.ambilpura\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

You can get the keystore from you eclipse
window>>preferences>>build>>you will find Default debug keystore:copy the that and past in the place of  yellow color place. and click on the enter

You will find the like the below


Please Send Your Comments To ambilpura.sunil@gmail.com






Stay Tune For Next Tutorial...  Google Maps Example In Android:

No comments:

Post a Comment