Html程序  |  42行  |  2.16 KB

<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 &mdash; 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 &mdash; 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>