Home | History | Annotate | Download | only in developing

Lines Matching full:code

89 <p>To create an Android project, you must use the <code>android</code> tool. When you create
90 a new project with <code>android</code>, it will generate a project directory
96 <p>If you're starting a new project, use the <code>android create project</code>
100 navigate to the <code>tools/</code> directory of your SDK and run:</p>
111 <li><code>target</code> is the "build target" for your application. It corresponds
114 execute: <code>android list targets</code>.</li>
115 <li><code>name</code> is the name for your project. This is optional. If provided, this name will
118 <li><code>path</code> is the location of your project directory. If the directory does not exist,
120 <li><code>activity</code> is the name for your default {@link android.app.Activity} class. This
124 <code><em>&lt;path_to_your_project&gt;</em>/src/<em>&lt;your_package_namespace_path&gt;</em>/</code>
126 This will also be used for your .apk filename unless you provide a the <code>name</code>.</li>
127 <li><code>package</code> is the package namespace for your project, following the same rules as
145 <li><code>AndroidManifest.xml</code> - The application manifest file,
147 <li><code>build.xml</code> - Build file for Ant.</li>
148 <li><code>default.properties</code> - Properties for the build system. <em>Do not modify
150 <li><code>build.properties</code> - Customizable properties for the build system. You can edit
155 <li><code>src<em>/your/package/namespace/ActivityName</em>.java</code> - The Activity class
157 <li><code>bin/</code> - Output directory for the build script.</li>
158 <li><code>gen/</code> - Holds <code>Ant</code>-generated files, such as <code>R.java</code>.
160 <li><code>libs/</code> - Holds private libraries.</li>
161 <li><code>res/</code> - Holds project resources.</li>
162 <li><code>src/</code> - Holds source code.</li>
163 <li><code>tests/</code> - Holds a duplicate of all-of-the-above, for testing purposes.</li>
169 (adb) &mdash; located in the SDK <code>tools/</code> directory &mdash; to send your application
171 the <code>tools/</code> folder.</p>
182 a new project from existing code, use the
183 <code>android update project</code> command to update the project to the new development
185 (with the <code>--target</code> option) and the project name (with the <code>--name</code>
186 option). The <code>android</code> tool will generate any files and
191 and navigate to the <code>tools/</code> directory of your SDK. Now run:</p>
198 <li><code>target</code> is the "build target" for your application. It corresponds to
202 execute: <code>android list targets</code>.</li>
203 <li><code>path</code> is the location of your project directory.</li>
204 <li><code>name</code> is the name for the project. This is optional&mdash;if you're not
266 in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of
268 <code>set JAVA_HOME=c:\Progra~1\Java\&lt;jdkdir&gt;</code>. The easiest solution, however, is to
269 install JDK in a non-space directory, for example: <code>c:\java\jdk1.6.0_02</code>.</p>
277 {@code zipalign}. However, you can (and should) also test your
287 <p>This creates your debug .apk file inside the project <code>bin/</code>
288 directory, named <code><em>&lt;your_project_name&gt;</em>-debug.apk</code>. The file
289 is already signed with the debug key and has been aligned with {@code zipalign}.</p>
308 {@code zipalign} tool. There are two approaches to building in release mode:
327 <p>This creates your Android application .apk file inside the project <code>bin/</code>
328 directory, named <code><em>&lt;your_project_name&gt;</em>-unsigned.apk</code>.</p>
334 with your private key and then align it with {@code zipalign}. To complete this procedure,
343 and the name of your key alias in your project's {@code build.properties} file. With this
357 <p>To specify your keystore and alias, open the project {@code build.properties} file (found in the
358 root of the project directory) and add entries for {@code key.store} and {@code key.alias}.
379 <p>This creates your Android application .apk file inside the project <code>bin/</code>
380 directory, named <code><em>&lt;your_project_name&gt;</em>-release.apk</code>.
382 {@code build.properties} and aligned with {@code zipalign}. It's ready for
406 <li>Navigate to your SDK's <code>tools/</code> directory and execute the {@code android}
456 <p>From your SDK's <code>tools/</code> directory, execute the {@code android} tool with no
463 <p>From your SDK's <code>tools/</code> directory, install the {@code .apk} on the
466 <p>Your APK file (signed with either a release or debug key) is in your project {@code bin/}
469 install the application, by its serial number, with the <code>-s</code> option. For example:</p>
471 <p>To see a list of available device serial numbers, execute {@code adb devices}.</p>
492 <code>ant install</code>. This will build your application, sign it with the debug key,
510 SDK's <code>tools/</code> directory and install the <code>.apk</code> on the device:
512 <p>The {@code -d} flag specifies that you want to use the attached device (in case you also
526 <h2>Library project example code</h2>
529 dependent application can use code and resources from an Android Library
530 project. The TicTacToeMain application uses code and resources from an example
537 <p style="margin-top:1em;">For more information and to browse the code of the
545 shared Android source code and resources. Other Android application projects can
547 in their <code>.apk</code> files. Multiple application projects can reference
551 <p>If you have source code and resources that are common to multiple application
570 as <code>src/</code>, <code>res/</code> and similar directories. The project can
571 contain the same types of source code and resources as a standard
572 Android project, stored in the same way. For example, source code in the library
573 project can access its own resources through its <code>R</code> class. </p>
576 project in that you cannot compile it directly to its own <code>.apk</code> or
584 then use the result to generate the <code>.apk</code>. In cases where a resource
587 library project is not compiled into the application <code>.apk</code>. This
591 <p>To organize your code further, your application can add references to
609 projects. Once you've set up your library projects and moved code into them, you
617 build a final application <code>.apk</code> that targets any API level and is
655 the <code>android</code> tool to generate a new library project with all of the
660 <p>To create a new library project, navigate to the <code>&lt;sdk&gt;/tools/</code> directory
670 <p>The <code>create lib-project</code> command creates a standard project
673 <code>default.properties</code> file: </p>
678 source code and resources into it, as described in the sections below.</p>
682 <code>android.library=true</code> property to the application's
683 <code>default.properties</code> file. </p>
694 example library project declares the Activity <code>GameActivity</code>: </p>
720 <p>If you are developing an application and want to include the shared code or
724 <p>To add a reference to a library project, navigate to the <code>&lt;sdk&gt;/tools/</code> directory
736 <code>android.library.reference.<em>n</em></code> property to the project's
737 <code>default.properties</code> file. For example: </p>
745 <code>default.properties</code> file and adjusting the each reference's
746 <code>.<em>n</em></code> index as appropriate. For example, assume these
756 <code>library_projectC</code> in this way:</p>
764 <p>Note that the <code>.<em>n</em></code> index in the references
778 project. For example, you must declare any <code>&lt;activity&gt;</code>,
779 <code>&lt;service&gt;</code>, <code>&lt;receiver&gt;</code>,
780 <code>&lt;provider&gt;</code>, and so on, as well as
781 <code>&lt;permission&gt;</code>, <code>&lt;uses-library&gt;</code>, and similar
789 example application declares the library Activity <code>GameActivity</code>
848 include the library in the application <code>.apk</code>. </p>
857 href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
871 <code>assets/</code> directory of the application project
895 <p>When you build the dependent application project, the code of any libraries
897 <code>R</code> class, named according to the library's package name. The
898 <code>R</code> class generated from the resources of the main project and of the
904 <p>There are two recommended ways of setting up testing on code and resources in
915 code to test.</li>