Android SDK includes a set of samples, allowing developers to check available features and learn how to use the APIs. Android plugin for Eclipse IDE makes it very easy for developers to play with the samples.
After installing the Eclipse, Android SDK manager, and ADT plugin for Eclipse,
you may first run the SDK manager to update all versions of Android SDK, 3rd party SDKs,
and you will find the samples under the folder where you installed Android SDK, for example, on my laptop, it is C:\android-sdk\samples. From there you can choose the sample of one SDK version.
1. Start up Eclipse IDE if it is not running.
2. From the menu, File-> New->Project -> Android -> Android Sample Project
3. In the dialogue window, choose "Next".
4. From the "Build Target" window, choose the version of the SDK from which the samples are included.
5. In the next window, please choose the sample you would like to check.
Now the sample project you select would be created in the workspace.
If you would like to load all of the samples coming with the SDK,
In the 2nd step above, you need to go the other way
2. From the menu, File -> New -> Project -> Android -> Android Project from Existing Code
3. Choose "Next"
4. From the dialogue window, choose the directory where the samples are located, for example C:\android-sdk\samples\android-16
5. Selected the projects you'd like to look at
6. If you'd like to, check "Copy projects into workspace".
7. Click "Finish".
Then the projects you selected would be loaded into Eclipse.
From here and on, you can dive into the source codes.
After building each project, you can install it to the device to play with it.
PS: I am using Eclipse 4.2 Juno 64bit for Windows.
No comments:
Post a Comment