xref: /aosp_15_r20/development/samples/TicTacToeMain/README.txt (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1*90c8c64dSAndroid Build Coastguard WorkerSample: TicTacToeLib and TicTacToeMain.
2*90c8c64dSAndroid Build Coastguard Worker
3*90c8c64dSAndroid Build Coastguard Worker--------
4*90c8c64dSAndroid Build Coastguard WorkerSummary:
5*90c8c64dSAndroid Build Coastguard Worker--------
6*90c8c64dSAndroid Build Coastguard Worker
7*90c8c64dSAndroid Build Coastguard WorkerThese two projects work together. They demonstrate how to use the ability to
8*90c8c64dSAndroid Build Coastguard Workersplit an APK into multiple projects.
9*90c8c64dSAndroid Build Coastguard Worker
10*90c8c64dSAndroid Build Coastguard WorkerBuild is supported both via Ant (command-line tools) or via ADT (the Android
11*90c8c64dSAndroid Build Coastguard Workerplugin for Eclipse).
12*90c8c64dSAndroid Build Coastguard Worker
13*90c8c64dSAndroid Build Coastguard Worker--------
14*90c8c64dSAndroid Build Coastguard WorkerDetails:
15*90c8c64dSAndroid Build Coastguard Worker--------
16*90c8c64dSAndroid Build Coastguard Worker
17*90c8c64dSAndroid Build Coastguard WorkerTicTacToeMain is the main project. It defines a main activity that is first
18*90c8c64dSAndroid Build Coastguard Workerdisplayed to the user. When one of the start buttons is selected, an
19*90c8c64dSAndroid Build Coastguard Workeractivity defined in TicTacToeLib is started.
20*90c8c64dSAndroid Build Coastguard Worker
21*90c8c64dSAndroid Build Coastguard WorkerTo define that TicTacToeMain uses TicTacToeLib as a "project library", the
22*90c8c64dSAndroid Build Coastguard Workerfile TicTacToeMain/default.properties contains the special line:
23*90c8c64dSAndroid Build Coastguard Worker  android.library.reference.1=../TicTacToeLib/
24*90c8c64dSAndroid Build Coastguard Worker
25*90c8c64dSAndroid Build Coastguard Worker
26*90c8c64dSAndroid Build Coastguard WorkerTicTacToeLib is the "project library". It can contain both source code (.java)
27*90c8c64dSAndroid Build Coastguard Workerand Android resources (anything under /res) that will be merged in the final
28*90c8c64dSAndroid Build Coastguard WorkerAPK. To define this is a library, the file TicTacToeLib/default.project
29*90c8c64dSAndroid Build Coastguard Workercontains the special line:
30*90c8c64dSAndroid Build Coastguard Worker  android.library=true
31*90c8c64dSAndroid Build Coastguard Worker
32*90c8c64dSAndroid Build Coastguard Worker
33*90c8c64dSAndroid Build Coastguard WorkerOne important thing to realize is that the library is not a separately-compiled
34*90c8c64dSAndroid Build Coastguard WorkerJAR file: the source and resources from the library are _actually_ merged in
35*90c8c64dSAndroid Build Coastguard Workerthe main project and the result is used to generate the APK. This means that
36*90c8c64dSAndroid Build Coastguard Workerthe main project can either use or redefine behavior from the libraries.
37*90c8c64dSAndroid Build Coastguard Worker
38*90c8c64dSAndroid Build Coastguard Worker
39*90c8c64dSAndroid Build Coastguard WorkerTo use the main vs library project:
40*90c8c64dSAndroid Build Coastguard Worker- In ADT, just open import both projects and launch the main project.
41*90c8c64dSAndroid Build Coastguard Worker- In Ant, use 'android update project' to create the build files and set the SDK location,
42*90c8c64dSAndroid Build Coastguard Worker  and then run 'ant debug' on the main project.
43*90c8c64dSAndroid Build Coastguard Worker
44*90c8c64dSAndroid Build Coastguard Worker
45*90c8c64dSAndroid Build Coastguard WorkerFor more details on the purpose of this feature, its limitations and detailed usage,
46*90c8c64dSAndroid Build Coastguard Workerplease read the SDK guide at
47*90c8c64dSAndroid Build Coastguard Worker  http://developer.android.com/guide/developing/eclipse-adt.html
48*90c8c64dSAndroid Build Coastguard Worker
49