Skip to content

Commit 56c8df1

Browse files
committed
sdk change: add index for tictactoe library and app. fix output path for spinner sample app in sdk builds.
Change-Id: I51d412e1e78e6bd672eb419d53310eb1194672a3
1 parent 6807387 commit 56c8df1

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

build/sdk.atree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ development/samples/Snake samples/${PLATFORM_NAME}/Snake
9898
development/samples/SoftKeyboard samples/${PLATFORM_NAME}/SoftKeyboard
9999
development/samples/JetBoy samples/${PLATFORM_NAME}/JetBoy
100100
development/samples/SearchableDictionary samples/${PLATFORM_NAME}/SearchableDictionary
101-
development/samples/Spinner samples/${PlATFORM_NAME}/Spinner
101+
development/samples/Spinner samples/${PLATFORM_NAME}/Spinner
102102
development/samples/SpinnerTest samples/${PLATFORM_NAME}/SpinnerTest
103103
development/samples/ContactManager samples/${PLATFORM_NAME}/ContactManager
104104
development/samples/MultiResolution samples/${PLATFORM_NAME}/MultiResolution

samples/TicTacToeLib/_index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<p>This application is an example of an Android library project, a type of
2+
project that lets you store and manage shared code and resources in one place,
3+
then make them available to your other Android applications. </p>
4+
5+
<p>The TicTacToeLib library project is designed to provide a game-play Activity,
6+
<code>GameActivity</code> to other applications. Dependent applications simply
7+
launch the Activity using an explicit intent &mdash; once launched,
8+
<code>GameActivity</code> assumes control of the application lifecycle and
9+
handles all events and UI interactions.</p>
10+
11+
<ul>
12+
<li>The library project includes an <a
13+
href="AndroidManifest.html">AndroidManifest.xml</a> file that
14+
declares <code>GameActivity</code>.</li>
15+
<li><a
16+
href="src/com/example/android/tictactoe/library/GameActivity.html">GameActivity.java</a>
17+
handles most of the application lifecycle and manages general game play.</li>
18+
<li><a
19+
href="src/com/example/android/tictactoe/library/GameView.html">GameView.java</a>
20+
renders the UI of the game and manages interaction events during game play.</li>
21+
</ul>
22+
23+
<p>If you want to build the TicTacToeLib application, you can obtain it by
24+
downloading the "Samples for SDK API 8" component (or higher version) into your
25+
SDK, using the <em>Android SDK and AVD Manager</em>. </p>
26+
27+
<p>Note that you can not build and run TicTacToeLib independently, since it is a
28+
library project and not a true Android application project. To run it, you need
29+
to build the application that uses the library project &mdash; in this case, the
30+
<a href="../TicTacToeMain/index.html">TicTacToeMain</a> application, which is also included in the Samples
31+
SDK comnponent. </p>
32+
33+
<p>To build an application that uses a library project, you also need to update
34+
to the latest version of the SDK tools (r6 or higher) and Android platforms, as
35+
well as the latest version of ADT (0.9.7 or higher), if you are developing in
36+
Eclipse. </p>
37+
38+
<p>For information about how to set up Android library projects, refer to
39+
<a href="../../../guide/developing/eclipse-adt.html#libraryProject">Developing
40+
in Eclipse with ADT</a> or <a
41+
href="../../../guide/developing/other-ide.html#libraryProject">Developing in
42+
Other IDEs</a>, depending on your environment.</p>

samples/TicTacToeMain/_index.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<p>This sample demonstrates how an application can make use of shared code and
2+
resources stored in an Android library project.</p>
3+
4+
<p>In this case, the TicTacToeMain application project includes a reference to
5+
the TicTacToeLib library project. When you build the TicTacToeMain application,
6+
the build tools look for the library project and compile it's code and resources
7+
as part of the main application's <code>.apk</code> file. The main application
8+
is designed with a launcher activity called <code>MainActivity</code>, shown at
9+
left, below. When the user presses a button in the View,
10+
<code>MainActivity</code> starts a second activity, <code>GameActivity</code>,
11+
which is declared in the library project. </p>
12+
13+
<ul>
14+
<li>The main application's <a
15+
href="AndroidManifest.html">AndroidManifest.xml</a> file contains declarations
16+
of both <code>MainActivity</code>, which is implemented locally in main project,
17+
and <code>GameActivity</code>, which is implemented in the library project.
18+
Currently, an application must declare in its manifest any components or
19+
resources that it is using from a library project.</li>
20+
<li><a
21+
href="src/com/example/android/tictactoe/MainActivity.html">MainActivity.java</a>
22+
shows how a class in the main application imports and uses
23+
classes from the library project. The Activity sets listeners on the buttons in
24+
the main View and, when one of them is clicked, creates an explicit Intent
25+
targeted at the <code>GameActivity</code> component declared in the TicTacToeLib
26+
library project. </li>
27+
</ul>
28+
29+
<p>The TicTacToeLib library project includes a single Activity,
30+
<code>GameActivity</code>, that handles most of the application lifecycle.</p>
31+
32+
<ul>
33+
<li>The library project includes an <a
34+
href="../TicTacToeLib/AndroidManifest.html">AndroidManifest.xml</a> file that
35+
declares <code>GameActivity</code>.</li>
36+
<li><a
37+
href="../TicTacToeLib/src/com/example/android/tictactoe/library/GameActivity.html">GameActivity.java</a>
38+
handles most of the application lifecycle and manages general game play.</li>
39+
<li><a
40+
href="../TicTacToeLib/src/com/example/android/tictactoe/library/GameView.html">GameView.java</a>
41+
renders the UI of the game and manages interaction events during game play.</li>
42+
</ul>
43+
44+
<p>If you want to build the TicTacToeMain application, you can obtain it by
45+
downloading the "Samples for SDK API 8" component (or higher version) into your
46+
SDK, using the <em>Android SDK and AVD Manager</em>. Note that the application
47+
project depends on code and resources found in the TicTacToeLib library project
48+
&mdash; in order to build TicTacToeMain, you need to add both projects to your
49+
development environment. </p>
50+
51+
<p>To build an application that uses a library project, you also need to update
52+
to the latest version of the SDK tools (r6 or higher) and Android platforms, as
53+
well as the latest version of ADT (0.9.7 or higher), if you are developing in
54+
Eclipse. </p>
55+
56+
<p>For information about how to set up Android library projects, refer to
57+
<a href="../../../guide/developing/eclipse-adt.html#libraryProject">Developing
58+
in Eclipse with ADT</a> or <a
59+
href="../../../guide/developing/other-ide.html#libraryProject">Developing in
60+
Other IDEs</a>, depending on your environment.</p>
61+
62+
<img alt="Screenshot of the main application" src="../images/TicTacToeMain.png" />
63+
<img alt="Screenshot of an Activity declared in a library project" src="../images/TicTacToeLib.png" />

0 commit comments

Comments
 (0)