Recently in late 2012 Google released a new version of its flagship maps API, Google Maps Android API v2. Initially Google Maps Android API v2, was released with humongous amount of bugs, which were later on fixed in Feb 2013 release. Google Maps Android API v2 is not released as a part of Android APIs, instead its released as a part of Google Play Services SDK. Therefore to use the features of Google Maps Android API v2, we need to include Google Play Services SDK in our project, this article Google Maps Android API v2 – Introduction, focuses on general feature introduction as well as creating a project with Google Maps Android API v2.
Google Maps Android API v2 Tutorials
Google Maps Android API v2 can be displayed in an android app via two classes MapFragment and SupportMapFragment. This article is the first of three, to explain the process of displaying Google Maps on Android. In this Google Maps Android API v2 – Introduction, I will be discussing basic features and lay foundation of Google Maps Android API v2 by explaining on how to include Google Play Services Library in our project. This article would be followed by 2 tutorials in this series:
Including Google Play Services SDK Library
As I stated earlier Google Maps Android API v2 is not included in Android API, its bundled with Google Play Services SDK. Therefore to use Google Maps on Android we need to include Google Play Services SDK Library in our project. At Truiton I followed these steps to create a project:
- Open Android SDK Manager -> Extras -> Google Play Services -> Install Packages.
- In Eclipse File-> Import -> Android -> Existing Android Code into Workspace -> Browse to your Android SDK Folder -> /Extras/google/google_play_services/libproject -> Finish.
- Create new android project -> After creating project right click on its folder and select properties.
- Goto “Android” property -> click add button below -> select “google-play-services_lib” -> hit Ok and you’re all set.
Google Maps Android API v2 Emulator Issue
It has been a topic of discussion on various forums, some people confirmed that they installed Google Play Store by vending.apk and gms.apk via ADB. But when I tried none of them worked for my config of emulator. I searched about it and found that Google has stated that Google Play Services SDK wont run on emulator, you can read it here.
Google Maps Android API v2 – Features
One of the features that I like about Google Maps Android API v2 is that it displays maps in 3D, you can pan and tilt the screen to view the buildings in 3D on your mobile device. Another good feature is that we can rotate the map according to out convenience. Also Google Maps Android API v2 has advantages from a developers perspective. For e.g. to display maps on an android device now, we have to use MapFragment and SupportMapFragment classes, over the previous method of using MapActivity. This way we can include a MapFragment in an Activity which could have some other functionality as well. This functionality alone can benefit many in many ways. With this I can conclude first part of my series on Google Maps Android API v2. If this tutorial helped you in some way please like and share this with your friends on Google+ and Facebook, also like our Facebook page for updates.
Born in New Delhi, India. A software engineer by profession, an android enthusiast and an evangelist. My motive here is to create a group of skilled developers, who can develop something new and good. Reason being programming is my passion, and also it feels good to make a device do something you want. In a very short span of time professionally I have worked with many tech firms. As of now too, I am employed as a senior engineer in a leading tech company. In total I may have worked on more than 20 projects professionally, and whenever I get spare time I share my thoughts here at Truiton.