am d7880b6a: docs: fix packaging instructions again to reflect correct metadata name

* commit 'd7880b6a50aa0dbea66923a4672d360229ab3aca':
  docs: fix packaging instructions again to reflect correct metadata name
This commit is contained in:
Robert Ly
2014-07-09 19:19:54 +00:00
committed by Android Git Automerger
3 changed files with 19 additions and 30 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 KiB

After

Width:  |  Height:  |  Size: 444 KiB

View File

@@ -48,7 +48,7 @@ types of screen shapes, which is useful for testing.</p>
<li>Click <b>Create...</b>.</li>
<li>Fill in the following details for the AVD you want to specify and leave the rest
of the fields with their default values:
<ol>
<ul>
<li><b>AVD Name</b> - A name for your AVD</li>
<li><b>Device</b> - Android Wear Round or Square device types</li>
<li><b>Target</b> - Android 4.4W - API Level 20</li>
@@ -57,7 +57,7 @@ types of screen shapes, which is useful for testing.</p>
<li><b>Skin</b> - AndroidWearRound or AndroidWearSquare depending on the selected device type</li>
<li><b>Snapshot</b> - Not selected</li>
<li><b>Use Host GPU</b> - Selected, to support custom activities for wearable notifications</li>
</ol>
</ul>
</li>
<li>Click <b>OK</b>.</li>
<li>Start the emulator:
@@ -119,8 +119,8 @@ Project</a>. As you follow the wizard, enter the following information:</p>
</ul>
</li>
<li>In the first <b>Add an Activity</b> window, add a blank activity for mobile.</li>
<li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.
<li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.</li>
</ol>
<p>When the wizard completes, Android Studio creates a new project with two modules, <b>mobile</b> and
<b>wear</b>. You now have a project for both your handheld and wearable apps that you can create activities,
services, custom layouts, and much more in. On the handheld app, you do most of the heavy lifting,
@@ -135,7 +135,7 @@ Project</a>. As you follow the wizard, enter the following information:</p>
by the <a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">wearable support library</a>.</p>
</li>
<h2 id="Install">Install the Wearable app</h2>
<h2 id="Install">Install the Wearable App</h2>
<p>When developing, you install apps directly to the wearable like with handheld apps. Use
either <code>adb install</code> or the <b>Play</b> button on Android Studio.</p>
@@ -178,12 +178,13 @@ you need the latest version of
If you're not using these APIs, remove the dependency from both modules.</p>
<b>Wearable UI support library</b>
<p>This is an unofficial library that includes UI widgets designed for wearables. We encourage you
to use them in your apps, because they exemplify best practices, but they can still
change at any time. However, if the libraries are updated, your apps won't break since they are compiled
into your app. To get new features from an updated library, you just need to
statically link the new version and update your app accordingly.
This library is only applicable if you create wearable apps.
<p>This is an unofficial library that includes
<a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">UI widgets designed for
wearables</a>. We encourage you to use them in your apps, because they exemplify best practices,
but they can still change at any time. However, if the libraries are updated, your apps won't
break since they are compiled into your app. To get new features from an updated library, you just
need to statically link the new version and update your app accordingly. This library is only
applicable if you create wearable apps.
</p>
<p>In the next lessons, you'll learn how to create layouts designed for wearables as well as how

View File

@@ -78,7 +78,6 @@ for information about how to create an environment variable for the passwords in
</p>
</ol>
<h3>Signing the wearable and handheld app separately</h3>
<p>If your build process requires signing the wearable app separately from the handheld app,
you can declare the following Gradle rule in the handheld module's <code>build.gradle</code> to
@@ -105,9 +104,9 @@ if you are using another IDE or another method of building.
<li>Copy the signed wearable app to your handheld project's <code>res/raw</code> directory. We'll
refer to the APK as <code>wearable_app.apk</code>.</li>
<li>Create a <code>res/xml/wearable_app_desc.xml</code> file that contains the version and
path information of the wearable app:
path information of the wearable app. For example:
<pre>
&lt;wearableApp package="com.google.android.wearable.myapp"&gt;
&lt;wearableApp package="wearable.app.package.name"&gt;
&lt;versionCode&gt;1&lt;/versionCode&gt;
&lt;versionName&gt;1.0&lt;/versionName&gt;
&lt;rawPathResId>wearable_app&lt;/rawPathResId&gt; <!-- Do not include the .apk extension -->
@@ -125,7 +124,7 @@ for <code>wearable_app.apk</code>, the static variable name is <code>wearable_ap
Add a <code>meta-data</code> tag to your handheld app's <code>&lt;application&gt;</code> tag to
reference the <code>wearable_app_desc.xml</code> file.
<pre>
&lt;meta-data android:name="com.google.android.wearable.myapp"
&lt;meta-data android:name="com.google.android.wearable.beta.app"
android:resource="&#64;xml/wearable_app_desc"/&gt;
</pre>
</li>
@@ -133,25 +132,14 @@ reference the <code>wearable_app_desc.xml</code> file.
</ol>
<h2 id="AssetCompression">Turn off Asset Compression</h2>
<p>
Many build tools automatically compress any files added to the <code>assets/</code>
<p>Many build tools automatically compress any files added to the <code>res/raw</code>
directory of an Android app. Because the wearable APK is already zipped, these tools re-compress the
wearable APK and the wearable app installer can no longer read the wearable app.
</p>
<p> When this happens, the installation fails. On the handheld app, the <code>PackageUpdateService</code>
<p>When this happens, the installation fails. On the handheld app, the <code>PackageUpdateService</code>
logs the following error: "this file cannot be opened as a file descriptor; it is probably compressed."
<p> To prevent this error in Android Studio, update your handheld app's <code>build.gradle</code> file
with the following declaration:
</p>
<pre>
android {
aaptOptions {
noCompress "apk"
}
}
</pre>
<p>If you are using another build process, ensure that you don't doubly compress the wearable app.</p>
<p>Android Studio doesn't compress your APK by default, but if you are using another build process,
ensure that you don't doubly compress the wearable app.</p>