For some reason this took me a while to get working. The basic idea is described by Sangjin Yun here, although there were a few twists perhaps related to the particular version of Android I'm using - Michael Trimarchi's freerunner-cupcake-snapshot-v15.jffs2 and uImage-v22.bin from here.
I'll take the liberty of repeating Sangjin's instructions here along with my minor modifications just so it is easy to understand.
1. Get the Maps.apk and com.google.android.maps.jar from the emulator.
You should also grab com.google.android.gtalkservice.jar from the emulator
The Maps.apk depends on the gtalkservice.
2. Enter the shell of your device.
- adb -d shell
3. Remount the system partition with read/write permissions.
- mount -o rw -t yaffs2 /dev/block/mtdblock3 /system
For me the remount was a bit different. The following did the trick
- mount -o remount,rw /dev/root /
4. Copy the files to the system directory.
- adb -d push Maps.apk /system/app/
- adb -d push com.google.android.maps.jar /system/framework/
I needed to install the files onto my moko a bit differently. Since Maps.apk depends on the two libraries it will not install first. Here is what I did:
- adb push com.google.android.maps.jar /system/framework/com.google.android.maps.jar
- adb push com.google.android.gtalkservice.jar /system/framework/com.google.android.gtalkservice.jar
5. Add the permission for maps.
I found it simplest just to adb pull platform.xml onto my host, edit it there, adding an entry for both maps and gtalkservice, and then adb push it back to the phone.
/etc/permissions/platform.xml
<permissions>
...
<!-- This is a list of all the libraries available for application code to link against. -->
<library name="android.awt" file="/system/framework/android.awt.jar">
<library name="android.test.runner" file="/system/framework/android.test.runner.jar">
<library name="com.android.im.plugin" file="/system/framework/com.android.im.plugin.jar">
<library name="com.google.android.maps" file="/system/framework/com.google.android.maps.jar">
<library name="com.google.android.gtalkservice" file="/system/framework/com.google.android.gtalkservice.jar">
</permissions>
6. At this point Maps.apk will still not load because the libraries are not yet registered. Restarting the device will allow the package manager to pick up and register the two new libraries. This can easily be done using
- adb stop
- adb start
Alex Buntu Reported that his version of adb does not support the stop and start command.
If you can't restart your device this way you can always resort the power cycling it.
Until the new libraries are properly registered you will get
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY] when trying to install Maps.apk
7. Now we can install Maps.apk. You should use adb install instead of adb push. push simply copies a file while install registers the package and check dependencies.
- adb install Maps.apk
8. Now you should be able to run Google Maps on your Android Freerunner.