As you may know, version 1.1 of the sdk came with a bunch of examples in the samples directory.
A huge part of that was the APIdemos project that was not included in 1.5 for some reason.
So if you do want to run it on the new SDK, this is what you have to do:
a) Download and extract the old (1.1) SDK here
b) Import the API project into your eclipse workspace
c) Change the project properties so that the project build target will be the Google APIs
d) Create a new AVD with the Google API target. see here for how-to's
e) Upadte the run configuration so that the target AVD will be the newly created one
f) Optional: you might find that in cameraPreview.java Line 69 you will get an error - an uncaught exception kind of thing. that is because the setPreviewDisplay method now throws an IOException that needs to be handled - just 'try catch' it and you'll be fine
If you need any more help, please comment here and I'll answer any questions you might have.
good luck
Elad Katz - Cool Stories
Showing posts with label AVD. Show all posts
Showing posts with label AVD. Show all posts
Tuesday, May 12, 2009
Monday, May 11, 2009
1st Pico-Post: How to add an SD card to an existing AVD (SDK 1.5 - Cupcake)
Hi, so first things first - what's a pico-post?
well it's basically a cool geeky way of saying a short post - I made it up and hopefully I'll make a few of those every once in a while.
Now for the pico-post itself:
With the shift to SDK v 1.5 the way that the android emulator works has been changed - you can now create several customized AVD's (Android Virtual Devices) that have different properties - this way you can test your app on several types of emulators and simulate different types of display settings etc.
The only problem is that the guys in Android forgot to add an update command to an existing AVD to add an SD card emulation.
This was much easier in the previous version of the API since all you had to do then is create an SD card and then run the emulator with a command line paramater saying - use this card (see here)
But in the new AVD that doesnt work, so we're gonna have to patch it up a bit
so for now here is the guide \ tutorial on how to add an SD card to an existing AVD in android SDK
1- find the path where your avd is stored by running the android list avd command:
2- create an "sdcard.img" in that directory -- that name is the
default and the emulator will pick it up automatically:
$ SDK/tools/mksdcard 16M /home/user/.android/avd/myAVD.avd/sdcard.img
You can pick any size you want\need for it
Note that "list avd" will not display it after (it only displays what's in the myAVD.avd/config.ini file...) so if you want it to show you can add a line like "sdcard=16M"
That's it.
Thanks to Raphael from the android handset alliance for helping me out on this!
well it's basically a cool geeky way of saying a short post - I made it up and hopefully I'll make a few of those every once in a while.
Now for the pico-post itself:
With the shift to SDK v 1.5 the way that the android emulator works has been changed - you can now create several customized AVD's (Android Virtual Devices) that have different properties - this way you can test your app on several types of emulators and simulate different types of display settings etc.
The only problem is that the guys in Android forgot to add an update command to an existing AVD to add an SD card emulation.
This was much easier in the previous version of the API since all you had to do then is create an SD card and then run the emulator with a command line paramater saying - use this card (see here)
But in the new AVD that doesnt work, so we're gonna have to patch it up a bit
so for now here is the guide \ tutorial on how to add an SD card to an existing AVD in android SDK
1- find the path where your avd is stored by running the android list avd command:
$ SDK/tools/android list avd
....
Path: /home/user/.android/avd/myAVD.avd
...
2- create an "sdcard.img" in that directory -- that name is the
default and the emulator will pick it up automatically:
$ SDK/tools/mksdcard 16M /home/user/.android/avd/myAVD.avd/sdcard.img
You can pick any size you want\need for it
Note that "list avd" will not display it after (it only displays what's in the myAVD.avd/config.ini file...) so if you want it to show you can add a line like "sdcard=16M"
That's it.
Thanks to Raphael from the android handset alliance for helping me out on this!
Subscribe to:
Posts (Atom)