am 7bf1c661: am 034d89d9: docs: cherrypick Change-Id: I3d871d494cf1f626df701efaa43058b66893259e docs: add info about customizing the density of an AVD from command line; and a few editorial things like fix the TOCs
* commit '7bf1c661f1a43236dd075616f4f04a776710dcb0': docs: cherrypick Change-Id: I3d871d494cf1f626df701efaa43058b66893259e docs: add info about customizing the density of an AVD from command line; and a few editorial things like fix the TOCs
This commit is contained in:
@@ -6,16 +6,27 @@ parent.link=index.html
|
||||
<div id="qv-wrapper">
|
||||
<div id="qv">
|
||||
<h2>In this document</h2>
|
||||
|
||||
<ol>
|
||||
<li><a href="#DebugMode">Building in debug mode</a></li>
|
||||
|
||||
<li><a href="#ReleaseMode">Building in release mode</a></li>
|
||||
|
||||
<li><a href="#RunningOnEmulator">Running on an emulator</a></li>
|
||||
|
||||
<li><a href="#RunningOnDevice">Running on a device</a></li>
|
||||
<li><a href="#DebugMode">Building in Debug Mode</a></li>
|
||||
<li><a href="#ReleaseMode">Building in Release Mode</a>
|
||||
<ol>
|
||||
<li><a href="#ManualReleaseMode">Build unsigned</a></li>
|
||||
<li><a href="#AutoReleaseMode">Build signed and aligned</a></li>
|
||||
<li><a href="#OnceBuilt">Once built and signed in release mode</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#RunningOnEmulator">Running on the Emulator</a></li>
|
||||
<li><a href="#RunningOnDevice">Running on a Device</a></li>
|
||||
<li><a href="#Signing">Application Signing</a></li>
|
||||
</ol>
|
||||
<h2>See also</h2>
|
||||
<ol>
|
||||
<li><a href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs from
|
||||
the Command Line</a></li>
|
||||
<li><a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android
|
||||
Emulator</a></li>
|
||||
<li><a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +65,7 @@ parent.link=index.html
|
||||
|
||||
<pre>c:\java\jdk1.6.0_02</pre>
|
||||
|
||||
<h2 id="DebugMode">Building in debug mode</h2>
|
||||
<h2 id="DebugMode">Building in Debug Mode</h2>
|
||||
|
||||
<p>For immediate application testing and debugging, you can build your application in debug mode
|
||||
and immediately install it on an emulator. In debug mode, the build tools automatically sign your
|
||||
@@ -83,7 +94,7 @@ ant debug
|
||||
<p>To install and run your application on an emulator, see the following section about <a href=
|
||||
"#RunningOnEmulator">Running on the Emulator</a>.</p>
|
||||
|
||||
<h2 id="ReleaseMode">Building in release mode</h2>
|
||||
<h2 id="ReleaseMode">Building in Release Mode</h2>
|
||||
|
||||
<p>When you're ready to release and distribute your application to end-users, you must build your
|
||||
application in release mode. Once you have built in release mode, it's a good idea to perform
|
||||
@@ -172,7 +183,7 @@ ant release
|
||||
been signed with the private key specified in {@code build.properties} and aligned with {@code
|
||||
zipalign}. It's ready for installation and distribution.</p>
|
||||
|
||||
<h3>Once built and signed in release mode</h3>
|
||||
<h3 id="OnceBuilt">Once built and signed in release mode</h3>
|
||||
|
||||
<p>Once you have signed your application with a private key, you can install and run it on an
|
||||
<a href="#RunningOnEmulator">emulator</a> or <a href="#RunningOnDevice">device</a>. You can
|
||||
@@ -181,7 +192,7 @@ ant release
|
||||
installation. (On your device, be sure you have enabled
|
||||
<em>Settings > Applications > Unknown sources</em>.)</p>
|
||||
|
||||
<h2 id="RunningOnEmulator">Running on the emulator</h2>
|
||||
<h2 id="RunningOnEmulator">Running on the Emulator</h2>
|
||||
|
||||
<p>Before you can run your application on the Android Emulator, you must <a href=
|
||||
"{@docRoot}guide/developing/devices/managing-avds.html">create an AVD</a>.</p>
|
||||
@@ -243,7 +254,7 @@ adb -s emulator-5554 install <em>path/to/your/app</em>.apk
|
||||
install</code>. This will build your application, sign it with the debug key, and install it on
|
||||
the currently running emulator.</p>
|
||||
|
||||
<h2 id="RunningOnDevice">Running on a device</h2>
|
||||
<h2 id="RunningOnDevice">Running on a Device</h2>
|
||||
|
||||
<p>Before you can run your application on a device, you must perform some basic setup for your
|
||||
device:</p>
|
||||
@@ -297,7 +308,7 @@ adb -d install <em>path/to/your/app</em>.apk
|
||||
<p>The ADT plugin helps you get started quickly by signing your .apk files with a debug key,
|
||||
prior to installing them on an emulator or development device. This means that you can quickly
|
||||
run your application from Eclipse without having to generate your own private key. No specific
|
||||
action on your part is needed, provided ADT has access to Keytool.However, please note that if
|
||||
action on your part is needed, provided ADT has access to Keytool. However, please note that if
|
||||
you intend to publish your application, you <strong>must</strong> sign the application with your
|
||||
own private key, rather than the debug key generated by the SDK tools.</p>
|
||||
|
||||
|
||||
@@ -7,12 +7,25 @@ parent.link=index.html
|
||||
<div id="qv">
|
||||
<h2>In this document</h2>
|
||||
<ol>
|
||||
<li><a href="#listingtargets">Listing targets</a></li>
|
||||
<li><a href="#AVDCmdLine">Creating AVDs</a></li>
|
||||
<li><a href="#listingtargets">Listing Targets</a></li>
|
||||
<li><a href="#AVDCmdLine">Creating AVDs</a>
|
||||
<ol>
|
||||
<li><a href="#CustomDensity">Customize the device resolution or density</a></li>
|
||||
<li><a href="#DefaultLocation">Default location of AVD files</a></li>
|
||||
<li><a href="#hardwareopts">Setting hardware emulation options</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#moving">Moving an AVD</a></li>
|
||||
<li><a href="#updating">Updating an AVD</a></li>
|
||||
<li><a href="#deleting">Deleting an AVD</a></li>
|
||||
</ol>
|
||||
<h2>See also</h2>
|
||||
<ol>
|
||||
<li><a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running
|
||||
from the Command Line</a></li>
|
||||
<li><a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android
|
||||
Emulator</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +36,7 @@ of the command line options that you can use, see the reference for the
|
||||
|
||||
|
||||
|
||||
<h2 id="listingtargets">Listing targets</h2>
|
||||
<h2 id="listingtargets">Listing Targets</h2>
|
||||
|
||||
<p>To generate a list of system image targets, use this command: </p>
|
||||
|
||||
@@ -67,7 +80,10 @@ id: 5 or "android-9"
|
||||
Skins: HVGA (default), WVGA800, WQVGA432, QVGA, WVGA854, WQVGA400
|
||||
</pre>
|
||||
|
||||
<h2 id="AVDCmdLine">Creating AVDs</h2>
|
||||
|
||||
|
||||
<h2 id="AVDCmdLine">Creating AVDs</h2>
|
||||
|
||||
<p>In addition to creating AVDs with the
|
||||
<a href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">AVD Manager user interface</a>,
|
||||
you can also create them by passing in command line arguments to the <code>android</code> tool.
|
||||
@@ -92,8 +108,9 @@ general characteristics offered by the AVD. The target ID is an integer assigned
|
||||
<code>android</code> tool. The target ID is not derived from the system image name,
|
||||
version, or API Level, or other attribute, so you need to run the <code>android list targets</code>
|
||||
command to list the target ID of each system image. You should do this <em>before</em> you run
|
||||
the <code>android create avd</code> command. See the <a href="{@docRoot}guide/developing/tools/android.html">android</a></p>
|
||||
tool documentation for more information on the command line options.
|
||||
the <code>android create avd</code> command. See the <a
|
||||
href="{@docRoot}guide/developing/tools/android.html">android</a>
|
||||
tool documentation for more information on the command line options.</p>
|
||||
|
||||
|
||||
<p>When you've selected the target you want to use and made a note of its ID,
|
||||
@@ -124,7 +141,45 @@ appropriately for the device that the add-on is modeling, and so prevents you
|
||||
from resetting the options. </p>
|
||||
|
||||
|
||||
<h3>Default location of AVD files</h3>
|
||||
<h3 id="CustomDensity">Customize the device resolution or density</h3>
|
||||
|
||||
<p>When testing your application, we recommend that you test your application in several different
|
||||
AVDs, using different screen configurations (different combinations of size and density). In
|
||||
addition, you should set up the AVDs to run at a physical size that closely matches an actual
|
||||
device.</p>
|
||||
|
||||
<p>To set up your AVDs for a specific resolution or density, follow these steps:</p>
|
||||
|
||||
<ol>
|
||||
<li>Use the <code>create avd</code> command to create a new AVD, specifying
|
||||
the <code>--skin</code> option with a value that references either a default
|
||||
skin name (such as "WVGA800") or a custom skin resolution (such as 240x432).
|
||||
Here's an example:
|
||||
<pre>android create avd -n <name> -t <targetID> --skin WVGA800</pre>
|
||||
</li>
|
||||
<li>To specify a custom density for the skin, answer "yes" when asked whether
|
||||
you want to create a custom hardware profile for the new AVD.</li>
|
||||
<li>Continue through the various profile settings until the tool asks you to
|
||||
specify "Abstracted LCD density" (<em>hw.lcd.density</em>). Enter an appropriate
|
||||
value, such as "120" for a low-density screen, "160" for a medium density screen,
|
||||
or "240" for a high-density screen.</li>
|
||||
<li>Set any other hardware options and complete the AVD creation.</li>
|
||||
</ol>
|
||||
|
||||
<p>In the example above (WVGA medium density), the new AVD will emulate a 5.8"
|
||||
WVGA screen.</p>
|
||||
|
||||
<p>As an alternative to adjusting the emulator skin configuration, you can use
|
||||
the emulator skin's default density and add the <code>-dpi-device</code> option
|
||||
to the <a href="{@docRoot}guide/developing/tools/emulator.html">emulator</a> command line when
|
||||
starting the AVD. For example:</p>
|
||||
|
||||
<pre>emulator -avd WVGA800 -scale 96dpi -dpi-device 160</pre>
|
||||
|
||||
|
||||
|
||||
<h3 id="DefaultLocation">Default location of AVD files</h3>
|
||||
|
||||
<p>When you create an AVD, the <code>android</code> tool creates a dedicated directory for it
|
||||
on your development computer. The directory contains the AVD configuration file,
|
||||
the user data image and SD card image (if available), and any other files
|
||||
@@ -153,7 +208,7 @@ The AVD's .ini file remains in the .android directory on the network
|
||||
drive, regardless of the location of the AVD directory.
|
||||
|
||||
|
||||
<h3 id="hardwareopts">Setting Hardware Emulation Options</h3>
|
||||
<h3 id="hardwareopts">Setting hardware emulation options</h3>
|
||||
|
||||
<p>When you are creating a new AVD that uses a standard Android system image ("Type:
|
||||
platform"), the <code>android</code> tool lets you set hardware emulation
|
||||
|
||||
@@ -9,13 +9,20 @@ parent.link=index.html
|
||||
|
||||
<ol>
|
||||
<li><a href="#CreatingAProject">Creating an Android Project</a></li>
|
||||
|
||||
<li><a href="#UpdatingAProject">Updating a Project</a></li>
|
||||
|
||||
<li><a href="#SettingUpLibraryProject">Setting up a Library Project</a></li>
|
||||
|
||||
<li><a href="#ReferencingLibraryProject">Referencing a Library Project from an
|
||||
Application</a></li>
|
||||
<li><a href="#SettingUpLibraryProject">Setting up a Library Project</a>
|
||||
<ol>
|
||||
<li><a href="#CreatingManifestFile">Creating the manifest file</a></li>
|
||||
<li><a href="#UpdatingLibraryProject">Updating a library project</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#ReferencingLibraryProject">Referencing a Library Project</a>
|
||||
<ol>
|
||||
<li><a href="#DeclaringLibrary">Declaring library components in the manifest
|
||||
file</a></li>
|
||||
<li><a href="#depAppBuild">Building a dependent application</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h2>See also</h2>
|
||||
@@ -108,7 +115,7 @@ android create project \
|
||||
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.)</p>
|
||||
|
||||
<h2 id="UpdatingAProject">Updating a project</h2>
|
||||
<h2 id="UpdatingAProject">Updating a Project</h2>
|
||||
|
||||
<p>If you're upgrading a project from an older version of the Android SDK or want to create a new
|
||||
project from existing code, use the <code>android update project</code> command to update the
|
||||
@@ -142,7 +149,7 @@ android update project --name <project_name> --target <target_ID>
|
||||
android update project --name MyApp --target 2 --path ./MyAppProject
|
||||
</pre>
|
||||
|
||||
<h2 id="SettingUpLibraryProject">Setting up a library project</h2>
|
||||
<h2 id="SettingUpLibraryProject">Setting up a Library Project</h2>
|
||||
|
||||
<p>A library project is a standard Android project, so you can create a new one in the same way
|
||||
as you would a new application project. Specifically, you can use the <code>android</code> tool
|
||||
@@ -171,7 +178,7 @@ android.library=true
|
||||
applications can use it, you can do so by adding a the <code>android.library=true</code> property
|
||||
to the application's <code>default.properties</code> file.</p>
|
||||
|
||||
<h4>Creating the manifest file</h4>
|
||||
<h3 id="CreatingManifestFile">Creating the manifest file</h3>
|
||||
|
||||
<p>A library project's manifest file must declare all of the shared components that it includes,
|
||||
just as would a standard Android application. For more information, see the documentation for
|
||||
@@ -191,7 +198,7 @@ android.library=true
|
||||
</manifest>
|
||||
</pre>
|
||||
|
||||
<h4>Updating a library project</h4>
|
||||
<h3 id="UpdatingLibraryProject">Updating a library project</h3>
|
||||
|
||||
<p>If you want to update the build properties (build target, location) of the library project,
|
||||
use this command:</p>
|
||||
@@ -249,7 +256,7 @@ android.library.reference.1=path/to/library_projectC
|
||||
that, at build time, libraries are not merged with each other before being merged with the
|
||||
application.</p>
|
||||
|
||||
<h3>Declaring library components in the the manifest file</h3>
|
||||
<h3 id="DeclaringLibrary">Declaring library components in the manifest file</h3>
|
||||
|
||||
<p>In the manifest file of the application project, you must add declarations of all components
|
||||
that the application will use that are imported from a library project. For example, you must
|
||||
|
||||
Reference in New Issue
Block a user