1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
page.title=Sample Code
@jd:body
<p>Sometimes, the best way to learn how things are done is to look at some code.</p>
<p>Here, you can browse the source of some sample Android applications. Also, each version of the
Android platform available for the SDK includes a set of sample
applications (which may vary between different versions of the platform).
You can find the samples in your SDK at:</p>
<p style="margin-left:2em">
<code><em><sdk></em>/platforms/android-<em><version></em>/samples/</code>
</p>
<p>You can easily create new Android projects with these samples, modify them
if you'd like, then run them on an emulator or device. For example, to create
a project for the API Demos app from Eclipse,
start a new Android Project, select "Create project from existing source", then select
{@code ApiDemos} in the {@code samples/} directory. To create the API Demos project
using the {@code android} tool, execute:</p>
<pre>
android update project -s -n API Demos -t <em><target_ID></em> -p <em><path-to-platform></em>/samples/ApiDemos/
</pre>
<p>The pages below provide an overview of each sample application (available with most
platforms) and allow you to view the source files in your browser. </p>
<div class="special">
<p>Some of the samples in this listing are not yet available in the
SDK. While we work to update the SDK, you can
<a href="{@docRoot}shareables/latest_samples.zip">download the latest samples</a> as a ZIP
archive.</p>
</div>
<dl>
<dt><a href="ApiDemos/index.html">API Demos</a></dt>
<dd>A variety of small applications that demonstrate an extensive collection of
framework topics.</dd>
<dt><a href="BluetoothChat/index.html">Bluetooth Chat</a></dt>
<dd>An application for two-way text messaging over Bluetooth.</dd>
<dt><a href="ContactManager/index.html">Contact Manager</a></dt>
<dd>An application that demonstrates how to query the system contacts provider
using the <code>ContactsContract</code> API, as
well as insert contacts into a specific account.</dd>
<dt><a href="Home/index.html">Home</a></dt>
<dd>A home screen replacement application.</dd>
<dt><a href="JetBoy/index.html">JetBoy</a></dt>
<dd>A game that demonstrates the SONiVOX JET interactive music technology,
with {@link android.media.JetPlayer}.</dd>
<dt><a href="LunarLander/index.html">Lunar Lander</a></dt>
<dd>A classic Lunar Lander game.</dd>
<dt><a href="MultiResolution/index.html">Multiple Resolutions</a></dt>
<dd>A sample application that shows how to use resource directory qualifiers to
provide different resources for different screen configurations.</dd>
<dt><a href="NotePad/index.html">Note Pad</a></dt>
<dd>An application for saving notes. Similar (but not identical) to the
<a href="{@docRoot}resources/tutorials/notepad/index.html">Notepad tutorial</a>.</dd>
<dt><a href="SearchableDictionary/index.html">Searchable Dictionary</a></dt>
<dd>A sample application that demonstrates Android's search framework,
including how to provide search suggestions for Quick Search Box.</dd>
<dt><a href="Snake/index.html">Snake</a></dt>
<dd>An implementation of the classic game "Snake."</dd>
<dt><a href="SoftKeyboard/index.html">Soft Keyboard</a></dt>
<dd>An example of writing an input method for a software keyboard.</dd>
<dt><a href="Wiktionary/index.html">Wiktionary</a></dt>
<dd>An example of creating interactive widgets for display on the Android
home screen.</dd>
<dt><a href="WiktionarySimple/index.html">Wiktionary (Simplified)</a></dt>
<dd>A simple Android home screen widgets example.</dd>
</dl>
<div class="special">
<p>For more sample applications, check out
<a href="http://code.google.com/p/apps-for-android/">apps-for-android</a>, a
collection of open source applications that demonstrate various Android APIs.
</p>
</div>
|