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 cupcake. Show all posts
Showing posts with label cupcake. 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!
Friday, May 1, 2009
Cupcake
So cupcake is out - also known as version 1.5 of the SDK.
As the early adopter that I am, I immediately went about to upgrading my project.
updating the ADT in eclipse was really quite simple (followed the instructions at http://developer.android.com/sdk/1.5_r1/upgrading.html ), but once the upgrade was complete the problems started...
First thing was that now you have to make you own Emulator (now known as AVD - Android Virtual Device) - that went pretty smoothly, the only thing that kinda bothered me is that the camcorder does not work in the emulator but according to google, it's not supposed to...(http://groups.google.com/group/android-developers/browse_thread/thread/a32a2f351f2fa004/9811bcf7bef9254d#9811bcf7bef9254d)
the second thing i noticed was that the device is a little sluggish but we'll see about that
third thing was that since the new API contains a new Widget for a sliding drawer

i of course tried to put it in my project but failed due to an exception which google is looking into:
http://groups.google.com/group/android-developers/browse_thread/thread/c579d40ff8bca172/58d4fcef1762259a#58d4fcef1762259a
next thing i noticed is that absoluteLayout is now deprecated :(
i knew it was a bad idea to use it the second i used it...
The reason i needed it was this:
notice the cards on the middle that are overlapping?
see the bottom cards that have some sticking up?
i'm gonna have to figure out a new way to do that without using the absolute layout...
stay tuned here or at http://code.google.com/p/bestcardgameever-android/
it'll show up soon
As the early adopter that I am, I immediately went about to upgrading my project.
updating the ADT in eclipse was really quite simple (followed the instructions at http://developer.android.com/sdk/1.5_r1/upgrading.html ), but once the upgrade was complete the problems started...
First thing was that now you have to make you own Emulator (now known as AVD - Android Virtual Device) - that went pretty smoothly, the only thing that kinda bothered me is that the camcorder does not work in the emulator but according to google, it's not supposed to...(http://groups.google.com/group/android-developers/browse_thread/thread/a32a2f351f2fa004/9811bcf7bef9254d#9811bcf7bef9254d)
the second thing i noticed was that the device is a little sluggish but we'll see about that
third thing was that since the new API contains a new Widget for a sliding drawer

i of course tried to put it in my project but failed due to an exception which google is looking into:
http://groups.google.com/group/android-developers/browse_thread/thread/c579d40ff8bca172/58d4fcef1762259a#58d4fcef1762259a
next thing i noticed is that absoluteLayout is now deprecated :(
i knew it was a bad idea to use it the second i used it...
The reason i needed it was this:
notice the cards on the middle that are overlapping?see the bottom cards that have some sticking up?
i'm gonna have to figure out a new way to do that without using the absolute layout...
stay tuned here or at http://code.google.com/p/bestcardgameever-android/
it'll show up soon
Subscribe to:
Posts (Atom)