Wednesday, October 16, 2013

Run Google maps v2 on Android emulator

Most of the time running an Android application which uses Google maps api v2 on the Android emulator is bit difficult. In this post I'm going to discuss what are the changes that we have to do to the AVD to make the  Google maps available on Android emulator.
Lets see how to do this.

1. First create non Google API emulator and API level should be higher than 3.0 (I didn't check for older versions) Change the all other settings as you want. Here I have shown settings that I have used.

2. Download necessary apks.
3. Install  the apks
  • To install apk on the emulator we need to use adb install command, make sure that the adb command is working on your system. If it is not for Windows, add the path of the Android platform tools directory to the Windows path. Then you should be able to run ADB commands.
  • Start the newly created emulator using Android Virtual Device Manager.
  • Open the windows command prompt and change the directory to where you downloaded the apks.
  • Run the following command to install the Google play services apk on the emulator
    adb install
  • Here the red colored part is the package name that you are going to install make sure that this is same as the apk name you have downloaded.
  • If the installation success you can see the Success message.
  • Then follow the same steps to install the Google play store apk.
  • Now the AVD is ready.
  • Run your own project or the project created in my previous tutorial by selecting the appropriate emulator from project run configurations.

1 comment: