diff --git a/docs/html/guide/developing/building/building-cmdline.jd b/docs/html/guide/developing/building/building-cmdline.jd index ec918dc7beef2..d78a4f55c0690 100644 --- a/docs/html/guide/developing/building/building-cmdline.jd +++ b/docs/html/guide/developing/building/building-cmdline.jd @@ -18,6 +18,7 @@ parent.link=index.html
Note: When installing JDK on Windows, the default is to install
in the "Program Files" directory. This location will cause ant to fail, because of
- the space. To fix the problem, you can specify the JAVA_HOME variable like this:
+ the space. To fix the problem, you can specify the JAVA_HOME variable like this:
set JAVA_HOME=c:\Progra~1\Java\<jdkdir>- +
The easiest solution, however, is to install JDK in a non-space directory, for example:
- +c:\java\jdk1.6.0_02
If you would like, you can configure the Android build script to automatically sign and align your application package. To do so, you must provide the path to your keystore and the name of - your key alias in your project's {@code build.properties} file. With this information provided, + your key alias in your project's {@code ant.properties} file. With this information provided, the build script will prompt you for your keystore and alias password when you build in release mode and produce your final application package, which will be ready for distribution.
@@ -152,7 +153,7 @@ ant release procedure manually, build unsigned and then continue with Signing Your Applications. -To specify your keystore and alias, open the project {@code build.properties} file (found in +
To specify your keystore and alias, open the project {@code ant.properties} file (found in the root of the project directory) and add entries for {@code key.store} and {@code key.alias}. For example:
@@ -180,16 +181,16 @@ ant releaseThis creates your Android application .apk file inside the project
bin/directory, named<your_project_name>-release.apk. This .apk file has - been signed with the private key specified in {@code build.properties} and aligned with {@code + been signed with the private key specified in {@code ant.properties} and aligned with {@code zipalign}. It's ready for installation and distribution.Once built and signed in release mode
Once you have signed your application with a private key, you can install and run it on an - emulator or device. You can - also try installing it onto a device from a web server. Simply upload the signed .apk to a web - site, then load the .apk URL in your Android web browser to download the application and begin - installation. (On your device, be sure you have enabled + emulator or device. You can + also try installing it onto a device from a web server. Simply upload the signed .apk to a web + site, then load the .apk URL in your Android web browser to download the application and begin + installation. (On your device, be sure you have enabled Settings > Applications > Unknown sources.)
Running on the Emulator
@@ -260,10 +261,6 @@ adb -s emulator-5554 install path/to/your/app.apk device:
android:debuggable attribute of the <application>
- element to true. As of ADT 8.0, this is done by default when you build in debug mode.Once your device is set up and connected via USB, navigate to your SDK's platform-tools/
directory and install the .apk on the device:
-adb -d install path/to/your/app.apk +adb -d install path/to/your/app.apk
The {@code -d} flag specifies that you want to use the attached device (in case you also have @@ -315,4 +312,60 @@ adb -d install path/to/your/app.apk
Please read Signing Your Applications, which provides a thorough guide to application signing on Android and what it means to you as an Android application developer. The document also includes a guide to exporting - and signing your application with the ADT's Export Wizard.
\ No newline at end of file + and signing your application with the ADT's Export Wizard. + +ant cleanall target before clean
+(ant all clean), other projects are also cleaned. For instance if you clean a
+test project, the tested project is also cleaned.ant debugant emma debugant releaseant instrument
+ emma
+ target)ant <build_target> installinstall by itself fails.ant installd.apk is not
+ already built.ant installr.apk is not
+ already built.ant installt.apk of the
+ tested application. This fails if the .apk is not already built.ant installi.apk is not already
+ built.ant test.apk files must be
+ previously installed.ant debug installt test.apk files, and
+ runs the tests.ant emma debug installt test.apk files, and
+ runs the tests with code coverage enabled..apk file at build time.menu/build.propertiesproject.propertieslocal.propertiesant.propertiesbuild.xmldefault.propertiesTo download the sample applications and run them as projects in your environment, use the Android SDK and AVD Manager to download the "Samples for - SDK API 8" component into your SDK.
+ SDK API 8" (or later) component into your SDK.For more information and to browse the code of the samples, see
the TicTacToeMain
@@ -212,9 +222,10 @@ page.title=Managing Projects
and, at build time, include its compiled sources in their .apk files. Multiple
application projects can reference the same library project and any single application project
can reference multiple library projects.
Note: You need SDK Tools r8 or newer to fully support library projects - for all Android platform versions. You can download the tools and platforms using the + +
Note: You need SDK Tools r14 or newer to use the new library + project feature that generates each library project into its own JAR file. + You can download the tools and platforms using the Android SDK and AVD Manager, as described in Adding SDK Components.
@@ -246,12 +257,12 @@ page.title=Managing Projects library in the dependent application and building that application.When you build an application that depends on a library project, the SDK tools compile the
- library and merge its sources with those in the main project, then use the result to generate
- the .apk. In cases where a resource ID is defined in both the application and the
- library, the tools ensure that the resource declared in the application gets priority and that
- the resource in the library project is not compiled into the application .apk.
- This gives your application the flexibility to either use or redefine any resource behaviors or
- values that are defined in any library.
.apk. In cases where a resource ID is defined in both the
+ application and the library, the tools ensure that the resource declared in the application gets
+ priority and that the resource in the library project is not compiled into the application
+ .apk. This gives your application the flexibility to either use or redefine any
+ resource behaviors or values that are defined in any library.
To organize your code further, your application can add references to multiple library projects, then specify the relative priority of the resources in each library. This lets you @@ -259,15 +270,13 @@ page.title=Managing Projects libraries referenced from an application define the same resource ID, the tools select the resource from the library with higher priority and discard the other.
-Once you have added references to library projects to your Android project, +
Once you have added references to library projects to your Android project, you can set their relative priority. At build time, the libraries are merged with the application one at a time, starting from the lowest priority to the highest.
-Note that a library project cannot itself reference another library project and that, at - build time, library projects are not merged with each other before being merged with - the application. However, note that a library can import an external library (JAR) in the - normal way.
+Library projects can reference other library projects and can import an external library + (JAR) in the normal way.
Use prefixes to avoid resource conflicts
To avoid resource conflicts for common resource IDs, consider using a prefix or other consistent naming scheme that is unique to the project (or is unique across all projects).
You cannot export a library project to a JAR file
-A library cannot be distributed as a binary file (such as a jar file). This is because the - library project is compiled by the main project to use the correct resource IDs.
A library cannot be distributed as a binary file (such as a JAR file). This will +be added in a future + version of the SDK Tools.
A library project can include a JAR library
You can develop a library project that itself includes a JAR library, however you need to manually edit the dependent application project's build path and add a path to the JAR file.
A library project can depend on an external JAR library
You can develop a library project that depends on an external library (for example, the Maps
@@ -316,7 +326,7 @@ page.title=Managing Projects
used by an application must be stored in the assets/ directory of the application
project itself. However, resource files saved in the
res/ directory are supported.
Platform version must be lower than or equal to the Android project
A library is compiled as part of the dependent application project, so the API used in the @@ -327,12 +337,12 @@ page.title=Managing Projects higher than that of the application, the application project will not compile. It is perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance.
No restriction on library package names
There is no requirement for the package name of a library to be the same as that of applications that use it.
Each library project creates its own R class
When you build the dependent application project, library projects are compiled and
@@ -340,7 +350,7 @@ page.title=Managing Projects
to the library's package name. The R class generated from main
project and the library project is created in all the packages that are needed including the main
project's package and the libraries' packages.
Library project storage location
There are no specific requirements on where you should store a library project, relative to a @@ -351,7 +361,7 @@ page.title=Managing Projects
Test projects contain Android applications that you write using the +
Test projects contain Android applications that you write using the
Testing and
Instrumentation framework. The framework is an extension of the JUnit test framework and adds
access to Android system objects. The file structure of a test project is the same as an
@@ -387,24 +397,36 @@ page.title=Managing Projects
<instrumentation>
element that connects the test project with the application project.
-
build.propertiesproject.propertieslocal.propertiesant.propertiesbuild.xmldefault.propertiesFor more information, see the Testing section.
The android tool provides you with commands to create all three types of
projects. An Android project contains all of the files and resources that are needed to build a
- project into an .apk file for installation.
-
+ project into an .apk file for installation.
+
platform-tools/ directory — to send your application to the emulator (discussed
later). So you need access between your project solution and the platform-tools/ folder.
-
+
Tip: Add the platform-tools/ as well as the tools/ directory
to your PATH environment variable.
Caution: You should refrain from moving the location of the - SDK directory, because this will break the build scripts. (They will need to be manually updated - to reflect the new SDK location before they will work again.)
+ SDK directory, because this will break the SDK location property located inlocal.properties.
+ If you need to update the SDK location, use the android update project command.
+ See Updating a Project for more information.
The create lib-project command creates a standard project structure that includes
preset property that indicates to the build system that the project is a library. It does this by
- adding this line to the project's default.properties file:
project.properties file:
android.library=true@@ -176,7 +177,7 @@ android.library=true
If you want to convert an existing application project to a library project, so that other
applications can use it, you can do so by adding a the android.library=true property
- to the application's default.properties file.
project.properties file.
This command updates the application project's build properties to include a reference to the
library project. Specifically, it adds an android.library.reference.n
- property to the project's default.properties file. For example:
project.properties file. For example:
android.library.reference.1=path/to/library_projectA
If you are adding references to multiple libraries, note that you can set their relative
- priority (and merge order) by manually editing the default.properties file and
+ priority (and merge order) by manually editing the project.properties file and
adjusting the each reference's .n index as appropriate. For example, assume
these references:
diff --git a/docs/html/guide/developing/tools/proguard.jd b/docs/html/guide/developing/tools/proguard.jd index b97babe764a28..eca262a3ba08e 100644 --- a/docs/html/guide/developing/tools/proguard.jd +++ b/docs/html/guide/developing/tools/proguard.jd @@ -59,7 +59,7 @@ parent.link=index.html customizing the ProGuard configuration file.To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the -
proguard.configproperty in the<project_root>/default.properties+proguard.configproperty in the<project_root>/project.propertiesfile. The path can be an absolute path or a path relative to the project's root.If you left the
diff --git a/docs/html/guide/developing/tools/zipalign.jd b/docs/html/guide/developing/tools/zipalign.jd index ebf177be926fe..3216080589370 100644 --- a/docs/html/guide/developing/tools/zipalign.jd +++ b/docs/html/guide/developing/tools/zipalign.jd @@ -21,7 +21,7 @@ will automatically zipalign your .apk after it signs it with your private key. The build scripts used when compiling your application with Ant will also zipalign your .apk, as long as you have provided the path to your keystore and the key alias in -your project {@code build.properties} file, so that the build tools +your project {@code ant.properties} file, so that the build tools can sign the package first.proguard.cfgfile in its default location (the project's root directory), you can specify its location like this:Caution: zipalign must only be performed diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd index df240e202c6b8..193c0fda8541c 100644 --- a/docs/html/guide/publishing/app-signing.jd +++ b/docs/html/guide/publishing/app-signing.jd @@ -434,13 +434,13 @@ key and then align it using {@code zipalign}.
However, the Ant build script can also perform the signing and aligning for you, if you have provided the path to your keystore and the name of -your key alias in the project's {@code build.properties} file. With this information provided, +your key alias in the project's {@code ant.properties} file. With this information provided, the build script will prompt you for your keystore and alias password when you perform
diff --git a/docs/html/guide/publishing/licensing.jd b/docs/html/guide/publishing/licensing.jd index d89a8ca810dc3..fc0de9d2ce6ff 100644 --- a/docs/html/guide/publishing/licensing.jd +++ b/docs/html/guide/publishing/licensing.jd @@ -662,7 +662,7 @@ name, package, and set other fields as needed.ant release, it will sign the package and then align it. The final output file in {@code bin/} will instead be<your_project_name>-release.apk. With these steps automated for you, you're able to skip the manual procedures below (steps 3 and 4). -To learn how to specify your keystore and alias in the {@code build.properties} file, +To learn how to specify your keystore and alias in the {@code ant.properties} file, see Building and Running Apps on the Command Line.
When created, the project is
-predefined as a library project in its default.properties file, so
+predefined as a library project in its project.properties file, so
no further configuration is needed.
For more information about how to create an application project or work with @@ -712,7 +712,7 @@ application from the application's project properties.
If you are developing using the SDK command-line tools, navigate to the
directory containing your application project and open the
-default.properties file. Add a line to the file that specifies the
+project.properties file. Add a line to the file that specifies the
android.library.reference.<n> key and the path to the
library. For example:
AndroidManifest.xmldefault.propertiesproject.propertiesAndroidManifest.xml - アプリケーションのマニフェスト ファイル。指定したプロジェクトの Activity クラスと同期されます。build.xml - Ant 用のビルド ファイルです。default.properties - ビルド システム用のプロパティです。このファイルを変更しないでください。build.properties - ビルド システム用のカスタマイズ可能なプロパティです。このファイルを編集して、Ant が使用するデフォルトのビルド設定をオーバーライドできます。project.properties - ビルド システム用のプロパティです。このファイルを変更しないでください。ant.properties - ビルド システム用のカスタマイズ可能なプロパティです。このファイルを編集して、Ant が使用するデフォルトのビルド設定をオーバーライドできます。src/your/package/namespace/ActivityName.java - プロジェクトの作成時に指定した Activity クラスです。bin/ - ビルド スクリプト用の出力ディレクトリです。gen/ - Ant が生成するファイル(R.java など)が含まれます。 build.properties. The name of the properties are
+ant.properties. The name of the properties are
key.store and key.alias respectively. If those
properties are present, the signing tool will prompt to enter the store/key
passwords during the build, and the script will sign and then align the apk