To help you understand some fundamental Android APIs and coding practices, a variety of sample code is available from the Android SDK Manager. Each version of the Android platform available from the SDK Manager offers its own set of sample apps.
To download the samples:
- Launch the Android SDK Manager.
- On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.
- On Mac or Linux, open a terminal to the
tools/directory in the Android SDK, then execute
- Expand the list of packages for the latest Android platform.
- Select and download Samples for SDK.
When the download is complete, you can find the source code for all samples at this location:
<version> number corresponds to the platform's
You can easily create new Android projects with the downloaded samples, modify them if you'd like, and then run them on an emulator or device.