blob: ed416e6a82db381d506029ad62d9a2e2c6900177 [file] [log] [blame]
Scott Main50e990c2012-06-21 17:14:39 -07001page.title=Samples
2
3@jd:body
4
5<p>To help you understand some fundamental Android APIs and coding practices, a variety of sample
Scott Main53b0fda2012-08-06 12:50:48 -07006code is available from the Android SDK Manager. Each version of the Android platform available
7from the SDK Manager offers its own set of sample apps.</p>
Scott Main50e990c2012-06-21 17:14:39 -07008
9<p>To download the samples:</p>
10<ol>
11 <li>Launch the Android SDK Manager.
12 <ul>
13 <li>On Windows, double-click the SDK Manager.exe file at the root of the Android SDK
14directory.</li>
15 <li>On Mac or Linux, open a terminal to the {@code tools/} directory in the
16Android SDK, then execute {@code android sdk}.</ul>
17 </li>
18 <li>Expand the list of packages for the latest Android platform.</li>
19 <li>Select and download <em>Samples for SDK</em>.</li>
20</ol>
21
Scott Main53b0fda2012-08-06 12:50:48 -070022<p>When the download is complete, you can find the source code for all samples at this location:</p>
Scott Main50e990c2012-06-21 17:14:39 -070023
24<p style="margin-left:2em">
Scott Main53b0fda2012-08-06 12:50:48 -070025<code>&lt;sdk&gt;/samples/android-&lt;version>/</code>
Scott Main50e990c2012-06-21 17:14:39 -070026</p>
27
Scott Main53b0fda2012-08-06 12:50:48 -070028<p>The {@code &lt;version>} number corresponds to the platform's
29 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a>.</p>
30
Scott Main50e990c2012-06-21 17:14:39 -070031<p>You can easily create new Android projects with the downloaded samples, modify them
Scott Main53b0fda2012-08-06 12:50:48 -070032if you'd like, and then run them on an emulator or device.</p>