Saturday, September 5, 2009

Android API Demos

Did you know that the Android SDK comes with a number of sample code? The SDK reference is very comprehensive, but it only documents the the various class individually. Examples are very useful in a learning process, it helps us to understand how concepts are translated to code, and how various components work together to accomplish a task. Unfortunately the SDK reference pages lack example. Besides the whole copy of SDK reference, the SDK package also comes with a number of sample projects. It is located in the <sdk>/platforms/android-1.5/samples folder. Follow the steps to load the project in Eclipse IDE:
  1. Goto: File > Import...
  2. In the Import window, select Existing Projects into workspace, click Next.
  3. For the Select root directory option, click on the Browse button.

  4. Import ApiDemos in the sample folder.
  5. Click Finish and the ApiDemos package will appear in the Package Explorer.
This project is an excellent resource for learning Android programming, and it covers a variety of topics (e.g. animation, widget, graphic, audio, video, ...). You might have noticed there are a number of other projects in the sample folder. Feel free to import them into your workspace, try them out. (If you are thinking of developing a game, JetBoy it a good starting point for learning audio programming.) P.S. Just found a reference website for using emulator:

No comments:

Post a Comment