sdk change: add index for tictactoe library and app. fix output path for spinner sample app in sdk builds.
Change-Id: I51d412e1e78e6bd672eb419d53310eb1194672a3
This commit is contained in:
@@ -98,7 +98,7 @@ development/samples/Snake samples/${PLATFORM_NAME}/Snake
|
||||
development/samples/SoftKeyboard samples/${PLATFORM_NAME}/SoftKeyboard
|
||||
development/samples/JetBoy samples/${PLATFORM_NAME}/JetBoy
|
||||
development/samples/SearchableDictionary samples/${PLATFORM_NAME}/SearchableDictionary
|
||||
development/samples/Spinner samples/${PlATFORM_NAME}/Spinner
|
||||
development/samples/Spinner samples/${PLATFORM_NAME}/Spinner
|
||||
development/samples/SpinnerTest samples/${PLATFORM_NAME}/SpinnerTest
|
||||
development/samples/ContactManager samples/${PLATFORM_NAME}/ContactManager
|
||||
development/samples/MultiResolution samples/${PLATFORM_NAME}/MultiResolution
|
||||
|
||||
42
samples/TicTacToeLib/_index.html
Normal file
42
samples/TicTacToeLib/_index.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<p>This application is an example of an Android library project, a type of
|
||||
project that lets you store and manage shared code and resources in one place,
|
||||
then make them available to your other Android applications. </p>
|
||||
|
||||
<p>The TicTacToeLib library project is designed to provide a game-play Activity,
|
||||
<code>GameActivity</code> to other applications. Dependent applications simply
|
||||
launch the Activity using an explicit intent — once launched,
|
||||
<code>GameActivity</code> assumes control of the application lifecycle and
|
||||
handles all events and UI interactions.</p>
|
||||
|
||||
<ul>
|
||||
<li>The library project includes an <a
|
||||
href="AndroidManifest.html">AndroidManifest.xml</a> file that
|
||||
declares <code>GameActivity</code>.</li>
|
||||
<li><a
|
||||
href="src/com/example/android/tictactoe/library/GameActivity.html">GameActivity.java</a>
|
||||
handles most of the application lifecycle and manages general game play.</li>
|
||||
<li><a
|
||||
href="src/com/example/android/tictactoe/library/GameView.html">GameView.java</a>
|
||||
renders the UI of the game and manages interaction events during game play.</li>
|
||||
</ul>
|
||||
|
||||
<p>If you want to build the TicTacToeLib application, you can obtain it by
|
||||
downloading the "Samples for SDK API 8" component (or higher version) into your
|
||||
SDK, using the <em>Android SDK and AVD Manager</em>. </p>
|
||||
|
||||
<p>Note that you can not build and run TicTacToeLib independently, since it is a
|
||||
library project and not a true Android application project. To run it, you need
|
||||
to build the application that uses the library project — in this case, the
|
||||
<a href="../TicTacToeMain/index.html">TicTacToeMain</a> application, which is also included in the Samples
|
||||
SDK comnponent. </p>
|
||||
|
||||
<p>To build an application that uses a library project, you also need to update
|
||||
to the latest version of the SDK tools (r6 or higher) and Android platforms, as
|
||||
well as the latest version of ADT (0.9.7 or higher), if you are developing in
|
||||
Eclipse. </p>
|
||||
|
||||
<p>For information about how to set up Android library projects, refer to
|
||||
<a href="../../../guide/developing/eclipse-adt.html#libraryProject">Developing
|
||||
in Eclipse with ADT</a> or <a
|
||||
href="../../../guide/developing/other-ide.html#libraryProject">Developing in
|
||||
Other IDEs</a>, depending on your environment.</p>
|
||||
63
samples/TicTacToeMain/_index.html
Normal file
63
samples/TicTacToeMain/_index.html
Normal file
@@ -0,0 +1,63 @@
|
||||
<p>This sample demonstrates how an application can make use of shared code and
|
||||
resources stored in an Android library project.</p>
|
||||
|
||||
<p>In this case, the TicTacToeMain application project includes a reference to
|
||||
the TicTacToeLib library project. When you build the TicTacToeMain application,
|
||||
the build tools look for the library project and compile it's code and resources
|
||||
as part of the main application's <code>.apk</code> file. The main application
|
||||
is designed with a launcher activity called <code>MainActivity</code>, shown at
|
||||
left, below. When the user presses a button in the View,
|
||||
<code>MainActivity</code> starts a second activity, <code>GameActivity</code>,
|
||||
which is declared in the library project. </p>
|
||||
|
||||
<ul>
|
||||
<li>The main application's <a
|
||||
href="AndroidManifest.html">AndroidManifest.xml</a> file contains declarations
|
||||
of both <code>MainActivity</code>, which is implemented locally in main project,
|
||||
and <code>GameActivity</code>, which is implemented in the library project.
|
||||
Currently, an application must declare in its manifest any components or
|
||||
resources that it is using from a library project.</li>
|
||||
<li><a
|
||||
href="src/com/example/android/tictactoe/MainActivity.html">MainActivity.java</a>
|
||||
shows how a class in the main application imports and uses
|
||||
classes from the library project. The Activity sets listeners on the buttons in
|
||||
the main View and, when one of them is clicked, creates an explicit Intent
|
||||
targeted at the <code>GameActivity</code> component declared in the TicTacToeLib
|
||||
library project. </li>
|
||||
</ul>
|
||||
|
||||
<p>The TicTacToeLib library project includes a single Activity,
|
||||
<code>GameActivity</code>, that handles most of the application lifecycle.</p>
|
||||
|
||||
<ul>
|
||||
<li>The library project includes an <a
|
||||
href="../TicTacToeLib/AndroidManifest.html">AndroidManifest.xml</a> file that
|
||||
declares <code>GameActivity</code>.</li>
|
||||
<li><a
|
||||
href="../TicTacToeLib/src/com/example/android/tictactoe/library/GameActivity.html">GameActivity.java</a>
|
||||
handles most of the application lifecycle and manages general game play.</li>
|
||||
<li><a
|
||||
href="../TicTacToeLib/src/com/example/android/tictactoe/library/GameView.html">GameView.java</a>
|
||||
renders the UI of the game and manages interaction events during game play.</li>
|
||||
</ul>
|
||||
|
||||
<p>If you want to build the TicTacToeMain application, you can obtain it by
|
||||
downloading the "Samples for SDK API 8" component (or higher version) into your
|
||||
SDK, using the <em>Android SDK and AVD Manager</em>. Note that the application
|
||||
project depends on code and resources found in the TicTacToeLib library project
|
||||
— in order to build TicTacToeMain, you need to add both projects to your
|
||||
development environment. </p>
|
||||
|
||||
<p>To build an application that uses a library project, you also need to update
|
||||
to the latest version of the SDK tools (r6 or higher) and Android platforms, as
|
||||
well as the latest version of ADT (0.9.7 or higher), if you are developing in
|
||||
Eclipse. </p>
|
||||
|
||||
<p>For information about how to set up Android library projects, refer to
|
||||
<a href="../../../guide/developing/eclipse-adt.html#libraryProject">Developing
|
||||
in Eclipse with ADT</a> or <a
|
||||
href="../../../guide/developing/other-ide.html#libraryProject">Developing in
|
||||
Other IDEs</a>, depending on your environment.</p>
|
||||
|
||||
<img alt="Screenshot of the main application" src="../images/TicTacToeMain.png" />
|
||||
<img alt="Screenshot of an Activity declared in a library project" src="../images/TicTacToeLib.png" />
|
||||
Reference in New Issue
Block a user