Elad Katz - Cool Stories

Tuesday, May 12, 2009

Running the Android API demos on the 1.5 SDK

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

1 comment: