40

Is there any way, how to get new x86 image for Android emulator working with Google Maps SDK?

Kara
  • 6,115
  • 16
  • 50
  • 57
sealskej
  • 7,281
  • 12
  • 53
  • 64
  • Well, nothing, I have no ideas. – sealskej Mar 25 '12 at 02:25
  • 4
    possible duplicate of http://stackoverflow.com/questions/9847111/accessing-google-apis-in-the-new-intel-x86-android-emulator – CommonsWare Mar 25 '12 at 11:24
  • I've submitted a feature request: http://code.google.com/p/android/issues/detail?id=34066 star it to support. – marmor Jul 02 '12 at 12:07
  • @marmor I think it is more Intel's issue then Google's. – sealskej Jul 15 '12 at 11:42
  • 1
    I have created ready tu run Android x86 images with Google Maps support. You can download them through my blog: http://www.seal.io/2012/09/android-x86-images-with-google-sdk-maps.html – sealskej Sep 02 '12 at 17:21

4 Answers4

45

First, make sure you follow the instructions to enable virtualization support for the emulator. If you don't, everything will work fine except you won't see a performance improvement:

http://developer.android.com/guide/developing/devices/emulator.html#vm-windows

Then follow these instructions to create an Android 2.3.3 AVD with Google Maps support, with corrections and thanks to http://38911bytes.blogspot.de/2012/03/how-to-use-google-maps-api-in-android.html:

  1. In Android Virtual Device Manager create an AVD with target "Google APIs (Google Inc.) - API Level 10"
  2. emulator -avd name_of_avd
  3. adb pull /system/etc/permissions/com.google.android.maps.xml
  4. adb pull /system/framework/com.google.android.maps.jar
  5. (optional) Remove the AVD you just created in the Android Virtual Device Manager
  6. In Android Virtual Device Manager create an AVD with target "Intel Atom x86 system Image (Intel Corporation) - API Level 10"
  7. emulator -partition-size 1024 -no-snapshot-save -avd name_of_avd
  8. adb remount rw
  9. adb push com.google.android.maps.xml /system/etc/permissions
  10. adb push com.google.android.maps.jar /system/framework
  11. Download mkfs.yaffs2.x86
  12. adb push mkfs.yaffs2.x86 /data
  13. adb shell
  14. cd /data
  15. chmod 777 mkfs.yaffs2.x86
  16. ./mkfs.yaffs2.x86 /system system.img
  17. exit
  18. adb pull /data/system.img (...be patient)
  19. Copy system.img into the avd directory for the avd you just created (likely in ~/.android/avd/name_of_avd.avd/)
  20. Reboot emulator

You're done! You can use essentially the same instructions using the new ICS (4.0.3) image if you want to use Google Maps on ICS.

emmby
  • 99,783
  • 65
  • 191
  • 249
  • FYI - If for some reason this emulator stops attaching for debugging, issue the -wipe-data command when you start the emulator to wipe all app data from the emulator. This seems to have helped me in the past when this emulator stopped responding to debug commands (simply would attach, then detach and kill the app somehow). – Donn Felker Jun 26 '12 at 04:05
  • amazing ! same steps works on VirtualBox too, just skip steps 18-19. thanks !! – Asaf Nevo Sep 09 '12 at 15:01
  • 1
    Works brilliantly. Are there other jars that can be copied to enable other parts of the google APIs? I am trying to get google's account authenticator to work on an intel emulator. This is the piece that allows AccountManager to understand "com.google" account types. – Dave Cameron Oct 05 '12 at 00:19
  • Great! It works as a charm. I only had to increase SD card/internal storage to at least 300MB. Big thanks! – Dragan Marjanović Dec 13 '12 at 16:37
  • 3
    And what about using GCM? These instructions are only for maps. – Raphael Oliveira Apr 26 '13 at 17:03
  • 2
    Do we know whether this procedure is allowed by Google's licensing terms for their Maps API and other things not included in vanilla Android? – Kristopher Johnson Jun 27 '13 at 21:39
  • Okay, so if you're trying to get this working, you might just want to try www.genymotion.com instead. As far as I can tell, genymotion is a much better android emulator – emmby Sep 22 '13 at 00:17
7

This tutorial works:

http://38911bytes.blogspot.de/2012/03/how-to-use-google-maps-api-in-android.html

Don't forget to use emulator -partition-size 1024 and android:installLocation="auto", preferExternal made me trouble.

sealskej
  • 7,281
  • 12
  • 53
  • 64
5

In the following link you can download the final avd and install it. Insanely useful! You only need to edit one .ini file to make this work. Just make sure before installing it that you can run the regular Intel Atom x86 avd without the maps sdk.

Or Sattath
  • 159
  • 2
  • 4
  • I had to change my SD card size for whatever reason before the ICS image would boot. It just hung at the Android screen. – loeschg Dec 06 '12 at 19:05
5

As of 4.4.2, the x86 Google API is provided by the SDK Manager.

enter image description here

Artem Russakovskii
  • 21,516
  • 18
  • 92
  • 115
  • 1
    This is the new best answer. I can confirm this worked out of the box with an app using the Maps v2 API. – ZoFreX Mar 07 '14 at 17:02