Archive

Posts Tagged ‘RecognizerIntent’

How to install a “real” firmware on your emulator (incl. Android Market)

December 2nd, 2009
Android Market on the Emulator

Android Market on the Emulator

Yesterday, I’ve tried to find a way to install a firmware with closed source apps on my Android 1.6 emulator. And let me explain why I did it and of course how.

I wanted to have a look at the Android Speech Recognizer API (RecognizerIntent) and was really impressed by the fact that there are only a few lines of code needed to use this feature. But after some digging, I found out that you would need an application on your device to take care of the speech analysis. Only with this app, you’ll be able to use this feature – and yes – there’s no app packaged with the emulator to provide that. The only application I knew was Google Voice… but: Google Voice is closed source and therefore not installed on the emulator. I had to find a way to get it somehow… Android Market? No, closed source -> not available.

So I made up my mind and remembered that someone told me once that the firmware images on the phone and on the emulator are pretty much the same. I’ve checked the AVD (Emulator = AVD = Android Virtual Device) folder to see how it stores its files… and yes, there were *.img files. If you don’t have such a directory, you need to create an Android 1.6 AVD first (you can use eclipse or command line) – I’ve created an AVD with a 1024MB sized SDCard.

You will find this directory in your home folder (e.g. on Linux/Mac):

~/.android/avd/MastiX_Donut.avd/

On HTC’s developer website they offer the Android Dev Phone Firmware (ADP1) to download… So I’ve downloaded the following file:

signed-dream_devphone_userdebug-img-14721.zip

I’ve tried the ION firmware (signed-google_ion-img-14721.zip) as well, but I was not able to get an internet connection. Link seems not work with Firefox (Ubuntu) and Chrome (Mac). But I can download it successfully using Safari 4 on my Macbook. Please try this. The problem is that you have to accept a license agreement, which is why I don’t want to/can’t provide that file. Maybe you need to install Safari 4 to download the files… could someone tell me if it worked with Safari 4 on Windows?

Edit: I’ve found a link that should work – BUT PLEASE READ THE LICENSE AGREEMENT ON HTC’s DEVELOPER SITE BEFORE DOWNLOADING THIS FILE.

http://dl.dropbox.com/u/1676562/signed-dream_devphone_userdebug-img-14721.zip
Also Gmail, Google Talk, etc. are available

Also Gmail, Google Talk, etc. are available

Ok, let’s continue… After extracting the downloaded file I was able to see that there’s a system.img file in there. This system.img did not exist in my current AVD folder, but I could see that it existed in the SDK folder:

./Development/android-sdk-linux_x86-1.6_r1/platforms/android-1.6/images/system.img

Fortunately the AVD itself supersedes this AVD-wide SDK setting as soon as it includes its own system.img file. The trick is to just copy the system.img file into the MastiX_Donut.avd folder. After that I’ve (of course) tried to run the emulator with the new firmware, but unfortunately it failed with the following exception:

emulator: ERROR: system image file too large for device's hardware configuration (78MB > 72MB)

This error is pretty easy to fix, you just need to put the following line into the AVD config file (.android/avd/MastiX_Donut.avd/config.ini):

disk.systemPartition.size=96MB

That’s it! I’ve started the emulator and after a quick boot sequence it forced me to enter my Google account credentials… (you need to switch to landscape mode to enter them – on a Macbook it would be Fn + Ctrl + F12!).

Now I was able to download Google Voice from the market and tested the speech stuff without any problems. :) It also synced my Google contacts to my emulator. Of course, I deleted the firmware after my test phase and returned to the standard emulator ROM!

Happy emulating,

Sascha

Android, Cell phones, Software Development , , , , , , , , , ,