Tuesday, 3 March 2015

How to Create Simple Maps Application using Android Studio with API Key Displaying on My Location & Zoom Controls

How to Create Simple Maps Application using Android Studio with API Key Displaying on My Location & Zoom Controls

MY Youtube Video



Requirements
***Android studio
***Android API Key

Simple Steps:

1. Open your Android studio

NOTE: if you dont have android studio please check my another blog here


2. Click "Start a new Android studio project"


3. Type your name of map application and package name  & click next


4. Select minimum SDK on API 17 & Slick Next


5. Select "Google Maps Activity" & Click Next


6. Put on maps activity name & Click Finish


wait for your project complete loading & gradle build

7. Create a Android API Key 

Copy the console link on your project it will go & register client key. console link like "https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=A0:8E:99:A3:D1:06:51:88:1C:CA:D8:30:9E:EA:4A:62:A9:13:4D:77%3Bcom.example.dell.myapplication"

NOTE: i post my console application, but you will see the http console link on your application "google_maps_api.xml"


 Now google login & and select your API project


select API project with number


it will show like


copy the API Key in your package name as by show, it show like "AIzaSyAk2BHeNM77AOFaY2kBzJrstybIPTNw1NM"

copy the API Key and paste your "google_maps_api.xml" on show "YOUR _KEY_HERE"


8. Create a AVD

 Tools-->Android-->AVD manager



you will see some emulator on your devices. 

Click --> create new device 


select Nexus 4 -> click Next


Select Lollipo API21 (Google API) x64 image file

Note: if u have 64 bit system select 64 bit, or 32bit choose that.but google API is must.

Now choose as you created one Nexus 4 x64 Google API , you select and run Nexus 4 API which you create, now you can see pop up at similar emulator like mobile device.


wait for till loading is completing, it il take long time. 



8. Now build & Run your application


9. Click Run

Run-> Run
 you will see gradle build task. after completing gradle task without error ,the application will run on emulator or a device.


  
You can zoom using touch & drag zooming



Note: this is result of your application.. simple map application.
you can modify the "views , my location, zoom controls, sattelite view" by the changing java code in your project. if u want to see that, go to my next blog here
CLICK TO NEXT BLOG

No comments:

Post a Comment