diff options
Diffstat (limited to 'docs/html')
23 files changed, 449 insertions, 147 deletions
diff --git a/docs/html/distribute/tools/promote/brand.jd b/docs/html/distribute/tools/promote/brand.jd index a12e753..cf83a5e 100644 --- a/docs/html/distribute/tools/promote/brand.jd +++ b/docs/html/distribute/tools/promote/brand.jd @@ -37,6 +37,18 @@ marketing for review.</p> <p>If used with your logo, "for Android" should be no larger than 90% of your logo’s size. First instance of this use should be followed by a TM symbol, "for Android™".</p> </li> + <li>"Android TV", "Android Wear" and "Android Auto" may only be used to identify or market + products or services with prior approval. Use "for Android" or "with Android" for all + other Android-based products + <ul> + <li><span style="color:red">Incorrect</span>: "Android TV Streaming Stick", + "Streaming Stick with Android TV"</li> + <li><span style="color:green">Correct</span>: "Streaming Stick with Android"</li> + </ul> + <p>If used with your logo, "for Android" or "with Android" should be no larger than 90% of + your logo’s size. First instance of this use should be followed by a TM symbol, + "for Android™".</p> + </li> <li>Android may be used as a descriptor, as long as it is followed by a proper generic term. (Think of "Android" as a term used in place of "the Android platform.") diff --git a/docs/html/google/auth/api-client.jd b/docs/html/google/auth/api-client.jd index e33721d..8f926f5 100644 --- a/docs/html/google/auth/api-client.jd +++ b/docs/html/google/auth/api-client.jd @@ -99,20 +99,23 @@ GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> by appending additional calls to -<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api)" +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>)" >{@code addApi()}</a> and <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addScope(com.google.android.gms.common.api.Scope)" >{@code addScope()}</a>.</p> <p class="caution"> -<strong>Important:</strong> To avoid client connection errors on devices that do not have the +<strong>Important:</strong> If you are adding multiple APIs to a +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code>GoogleApiClient</code></a>, +you may run into client connection errors on devices that do not have the <a href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> installed, use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access only the <a +Wear app</a> installed. To avoid connection errors, call the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApiIfAvailable(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>, com.google.android.gms.common.api.Scope...)">{@code addApiIfAvailable()}</a> +method and pass in the <a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API. For more information, see <a href="#WearableApi">Access the Wearable -API</a>.</p> +Wearable}</a> API to indicate that your client should gracefully handle the missing API. +For more information, see <a +href="{@docRoot}google/auth/api-client.html#WearableApi">Access the Wearable API</a>.</p> <p>Before you can begin a connection by calling <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()" @@ -421,27 +424,52 @@ consult the corresponding documentation, such as for <h3 id="WearableApi">Access the Wearable API</h3> -<p>On devices that do not have the <a -href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> installed, connection requests that include the <a +<p>The Wearable API provides a communication channel for your handheld and wearable apps. The API +consists of a set of data objects that the system can send and synchronize over the wire and +listeners that notify your apps of important events with the data layer. The +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available on devices running Android 4.3 (API level 18) or higher when a wearable device is +connected. The API is not available under the following conditions: +</p> + +<ul> +<li>Devices running Android 4.2 (API level 17) or earlier.</li> +<li><a href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android +Wear companion app</a> is not installed on the device.</li> +<li>Android Wear device is not connected.</li> +</ul> + +<h4 id="OnlyWearableApi">Using only the Wearable API</h4> + +<p>If your app uses the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API but not other Google APIs, you can add this API by calling the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>)" +>{@code addApi()}</a> method. The following example shows how to add the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API to your <a +href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code +GoogleApiClient}</a> instance:</p> + +<pre> +GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(Wearable.API) + .build(); +</pre> + +<p>In situations where the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is not available, connection requests that include the <a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> API fail with the <a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#API_UNAVAILABLE"> -<code>API_UNAVAILABLE</code></a> error code. If your app uses the <a -href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API in addition to other Google APIs, use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access the <a -href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API. This approach enables you to access other Google APIs on devices that are not -paired with a wearable device.</p> +<code>API_UNAVAILABLE</code></a> error code.</p> -<p>When you use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access only the Wearable API, you can determine -whether the <a -href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> is installed on the device:</p> +<p> +The following example shows how to determine whether the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available: +</p> <pre> // Connection failed listener method for a client that only @@ -449,15 +477,55 @@ Wear app</a> is installed on the device:</p> @Override public void onConnectionFailed(ConnectionResult result) { if (result.getErrorCode() == ConnectionResult.API_UNAVAILABLE) { - // The Android Wear app is not installed + // The Wearable API is unavailable } ... } </pre> +<h4 id="WearableApiWithOthers">Using the Wearable API with other APIs</h4> + +<p> +If your app uses the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API in addition to other Google APIs, call the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApiIfAvailable(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>, com.google.android.gms.common.api.Scope...)">addApiIfAvailable()</a> +method and pass in the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API to indicate that your client should gracefully handle the missing API.</p> +<p>The following example shows how to access the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API along with the +<a href="{@docRoot}reference/com/google/android/gms/drive/DriveApi.html">{@code Drive}</a> +API:</p> +<pre> +// Create a GoogleApiClient instance +mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(Drive.API) + .addApiIfAvailable(Wearable.API) + .addScope(Drive.SCOPE_FILE) + .addConnectionCallbacks(this) + .addOnConnectionFailedListener(this) + .build(); +</pre> + +<p>In the example above, the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> +can successfully connect with the Google Drive service without connecting to the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API if it is unavailable. After you connect your +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> +instance, ensure that the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available before making the API calls: +</p> + +<pre> +mGoogleApiClient.hasConnectedApi(Wearable.API); +</pre> <h2 id="Communicating">Communicate with Google Services</h2> diff --git a/docs/html/google/auth/http-auth.jd b/docs/html/google/auth/http-auth.jd index 804ba12..7d34d89 100644 --- a/docs/html/google/auth/http-auth.jd +++ b/docs/html/google/auth/http-auth.jd @@ -95,7 +95,7 @@ keytool -exportcert -alias <keystore_alias> -keystore <keystore_path> -lis </pre> <p>For example, you're using a debug-key with Eclipse, then the command looks like this:</p> <pre class="no-pretty-print"> -keytool -exportcert -alias androiddebugkey-keystore ~/.android/debug.keystore -list -v +keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v </pre> <p>Then the keystore password is "android".</p> </li> diff --git a/docs/html/google/play-services/index.jd b/docs/html/google/play-services/index.jd index e31290a..5ccdcb9 100644 --- a/docs/html/google/play-services/index.jd +++ b/docs/html/google/play-services/index.jd @@ -74,30 +74,8 @@ announcement <a href="http://android-developers.blogspot.com/2015/04/theres-lot-to-explore-with-google-play.html" class="external-link">blog post</a>.</p> <ul> - <li><strong>Maps</strong> - This release makes the Google Maps Android API v2 available on -<a href="https://developers.google.com/maps/documentation/android/wear" class="external-link"> -Android Wear</a>, so you can now create map-based apps that run directly on wearable devices. In -addition, the Maps API now offers a new -<a href="{@docRoot}reference/com/google/android/gms/maps/StreetViewPanorama.OnStreetViewPanoramaLongClickListener.html"> -{@code OnStreetViewPanoramaLongClickListener}</a> interface, similar to the existing -<a href="{@docRoot}reference/com/google/android/gms/maps/GoogleMap.OnMapLongClickListener.html"> -{@code OnMapLongClickListener}</a> interface. These listeners are particularly helpful -for wearable devices, so you can let users exit from the app by long-clicking on a map or panorama. -On a wearable device, the swipe gesture is used to pan the map instead of exiting the app. - <ul> - <li><a href="https://developers.google.com/maps/documentation/android/wear" - class="external-link">Google Maps on Android Wear developer guide</a> - </li> - <li><a href="https://github.com/googlemaps/android-samples" - class="external-link">Google Maps on Android Wear sample</a> - </li> - <li><a href="https://developers.google.com/maps/documentation/android/releases" - class="external-link">Release notes</a> - </li> - </ul> - </li> <li> - <strong>Wear</strong> - In addition to Maps support, this release provides you with the ability + <strong>Wear</strong> - This release provides you with the ability to advertise and discover the capabilities of devices that are connected in a Wear network, through the new <a href="{@docRoot}reference/com/google/android/gms/wearable/CapabilityApi.html"> {@code CapabilityApi}</a> class. The new diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd index af60eb7..db518f9 100644 --- a/docs/html/guide/appendix/glossary.jd +++ b/docs/html/guide/appendix/glossary.jd @@ -94,7 +94,7 @@ excludeFromSuggestions=true Plugin, DDMS is integrated into your development environment. See <a href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a> to learn more about the program.</dd> - <dt id="dialog">Dialog</dt> <dd> A floating window that that acts as a lightweight + <dt id="dialog">Dialog</dt> <dd> A floating window that acts as a lightweight form. A dialog can have button controls only and is intended to perform a simple action (such as button choice) and perhaps return a value. A dialog is not intended to persist in the history stack, contain complex layout, diff --git a/docs/html/guide/components/processes-and-threads.jd b/docs/html/guide/components/processes-and-threads.jd index e7ef7ba..10a6410 100644 --- a/docs/html/guide/components/processes-and-threads.jd +++ b/docs/html/guide/components/processes-and-threads.jd @@ -274,7 +274,8 @@ android.view.View#post(java.lang.Runnable) View.post(Runnable)} method:</p> public void onClick(View v) { new Thread(new Runnable() { public void run() { - final Bitmap bitmap = loadImageFromNetwork("http://example.com/image.png"); + final Bitmap bitmap = + loadImageFromNetwork("http://example.com/image.png"); mImageView.post(new Runnable() { public void run() { mImageView.setImageBitmap(bitmap); @@ -323,7 +324,7 @@ private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { protected Bitmap doInBackground(String... urls) { return loadImageFromNetwork(urls[0]); } - + /** The system calls this to perform work in the UI thread and delivers * the result from doInBackground() */ protected void onPostExecute(Bitmap result) { diff --git a/docs/html/guide/faq/commontasks.jd b/docs/html/guide/faq/commontasks.jd index 086721f..2943aef 100644 --- a/docs/html/guide/faq/commontasks.jd +++ b/docs/html/guide/faq/commontasks.jd @@ -653,7 +653,7 @@ and the {@link android.os.Handler} documentation.</p> <p>You can highlight or style the formatting of strings or substrings of text in a TextView object. There are two ways to do this:</p> <ul> - <li>If you use a <a href="{@docRoot}guide/topics/resources/available-resources.html#stringresources">string resource</a>, + <li>If you use a <a href="{@docRoot}guide/topics/resources/string-resource.html">string resource</a>, you can add some simple styling, such as bold or italic using HTML notation. The currently supported tags are: <code>B</code> (bold), <code>I</code> (italic), <code>U</code> (underline), @@ -661,8 +661,8 @@ and the {@link android.os.Handler} documentation.</p> <code>SUP</code> (superscript), <code>SUB</code> (subscript), and <code>STRIKE</code> (strikethrough). So, for example, in res/values/strings.xml you could declare this:<br /> - <code><resource><br /> - <string id="@+id/styled_welcome_message">We + <code><resources><br /> + <string name="styled_welcome_message">We are <b><i>so</i></b> glad to see you.</string><br /> </resources></code></li> <li>To style text on the fly, or to add highlighting or more complex styling, diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd index 4b5a121..9cae53c 100644 --- a/docs/html/guide/topics/graphics/2d-graphics.jd +++ b/docs/html/guide/topics/graphics/2d-graphics.jd @@ -228,9 +228,9 @@ graphics such as those used in a game.</p> <p>The following code snippet demonstrates how to build an {@link android.widget.ImageView} that uses an image from drawable resources and add it to the layout.</p> <pre> - LinearLayout mLinearLayout; +LinearLayout mLinearLayout; - protected void onCreate(Bundle savedInstanceState) { +protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create a LinearLayout in which to add the ImageView @@ -241,20 +241,20 @@ graphics such as those used in a game.</p> i.setImageResource(R.drawable.my_image); i.setAdjustViewBounds(true); // set the ImageView bounds to match the Drawable's dimensions i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, - LayoutParams.WRAP_CONTENT)); + LayoutParams.WRAP_CONTENT)); // Add the ImageView to the layout and set the layout as the content view mLinearLayout.addView(i); setContentView(mLinearLayout); - } +} </pre> <p>In other cases, you may want to handle your image resource as a {@link android.graphics.drawable.Drawable} object. To do so, create a Drawable from the resource like so: <pre> - Resources res = mContext.getResources(); - Drawable myImage = res.getDrawable(R.drawable.my_image); - </pre> +Resources res = mContext.getResources(); +Drawable myImage = res.getDrawable(R.drawable.my_image); +</pre> <p class="warning"><strong>Note:</strong> Each unique resource in your project can maintain only one state, no matter how many different objects you may instantiate for it. For example, if you @@ -269,12 +269,12 @@ animation</a>.</p> <p>The XML snippet below shows how to add a resource Drawable to an {@link android.widget.ImageView} in the XML layout (with some red tint just for fun). <pre> - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:tint="#55ff0000" - android:src="@drawable/my_image"/> - </pre> +<ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:tint="#55ff0000" + android:src="@drawable/my_image"/> +</pre> <p>For more information on using project resources, read about <a href="{@docRoot}guide/topics/resources/index.html">Resources and Assets</a>.</p> @@ -305,22 +305,22 @@ specific XML attributes that help define the object <h4 id="drawable-xml-example">Example</h4> <p>Here's some XML that defines a TransitionDrawable:</p> <pre> - <transition xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/image_expand"> - <item android:drawable="@drawable/image_collapse"> - </transition> - </pre> +<transition xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/image_expand"> + <item android:drawable="@drawable/image_collapse"> +</transition> +</pre> <p>With this XML saved in the file <code>res/drawable/expand_collapse.xml</code>, the following code will instantiate the TransitionDrawable and set it as the content of an ImageView:</p> <pre> - Resources res = mContext.getResources(); - TransitionDrawable transition = (TransitionDrawable) -res.getDrawable(R.drawable.expand_collapse); - ImageView image = (ImageView) findViewById(R.id.toggle_image); - image.setImageDrawable(transition); - </pre> +Resources res = mContext.getResources(); +TransitionDrawable transition = (TransitionDrawable) + res.getDrawable(R.drawable.expand_collapse); +ImageView image = (ImageView) findViewById(R.id.toggle_image); +image.setImageDrawable(transition); +</pre> <p>Then this transition can be run forward (for 1 second) with:</p> <pre>transition.startTransition(1000);</pre> @@ -337,7 +337,7 @@ supported by each.</p> primitive shapes and style them in any way imaginable.</p> <p>A ShapeDrawable is an extension of {@link android.graphics.drawable.Drawable}, so you can use -one where ever +one wherever a Drawable is expected — perhaps for the background of a View, set with {@link android.view.View#setBackgroundDrawable(android.graphics.drawable.Drawable) setBackgroundDrawable()}. @@ -349,27 +349,27 @@ View that Here's a basic extension of the View class that does just this, to draw a ShapeDrawable as a View:</p> <pre> - public class CustomDrawableView extends View { - private ShapeDrawable mDrawable; +public class CustomDrawableView extends View { + private ShapeDrawable mDrawable; - public CustomDrawableView(Context context) { - super(context); + public CustomDrawableView(Context context) { + super(context); - int x = 10; - int y = 10; - int width = 300; - int height = 50; + int x = 10; + int y = 10; + int width = 300; + int height = 50; - mDrawable = new ShapeDrawable(new OvalShape()); - mDrawable.getPaint().setColor(0xff74AC23); - mDrawable.setBounds(x, y, x + width, y + height); - } + mDrawable = new ShapeDrawable(new OvalShape()); + mDrawable.getPaint().setColor(0xff74AC23); + mDrawable.setBounds(x, y, x + width, y + height); + } - protected void onDraw(Canvas canvas) { - mDrawable.draw(canvas); - } - } - </pre> + protected void onDraw(Canvas canvas) { + mDrawable.draw(canvas); + } +} +</pre> <p>In the constructor, a ShapeDrawable is defines as an {@link android.graphics.drawable.shapes.OvalShape}. @@ -379,15 +379,15 @@ then the <p>With the custom View defined, it can be drawn any way you like. With the sample above, we can draw the shape programmatically in an Activity:</p> <pre> - CustomDrawableView mCustomDrawableView; +CustomDrawableView mCustomDrawableView; - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mCustomDrawableView = new CustomDrawableView(this); +protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mCustomDrawableView = new CustomDrawableView(this); - setContentView(mCustomDrawableView); - } - </pre> + setContentView(mCustomDrawableView); +} +</pre> <p>If you'd like to draw this custom drawable from the XML layout instead of from the Activity, then the CustomDrawable class must override the {@link @@ -396,11 +396,11 @@ then the instantiating a View via inflation from XML. Then add a CustomDrawable element to the XML, like so:</p> <pre> - <com.example.shapedrawable.CustomDrawableView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - </pre> +<com.example.shapedrawable.CustomDrawableView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + /> +</pre> <p>The ShapeDrawable class (like many other Drawable types in the {@link android.graphics.drawable} package) diff --git a/docs/html/guide/topics/manifest/service-element.jd b/docs/html/guide/topics/manifest/service-element.jd index 2213b72..e26f263 100644 --- a/docs/html/guide/topics/manifest/service-element.jd +++ b/docs/html/guide/topics/manifest/service-element.jd @@ -138,7 +138,7 @@ There is no default. The name must be specified. </p></dd> <dt><a name="prmsn"></a>{@code android:permission}</dt> -<dd>The name of a permission that that an entity must have in order to +<dd>The name of a permission that an entity must have in order to launch the service or bind to it. If a caller of <code>{@link android.content.Context#startService startService()}</code>, <code>{@link android.content.Context#bindService bindService()}</code>, or @@ -156,7 +156,7 @@ not protected by a permission. <p> For more information on permissions, see the -<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a> +<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a> section in the introduction and a separate document, <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>. </p></dd> diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd index 1ee6606..0a96a15 100644 --- a/docs/html/guide/topics/resources/localization.jd +++ b/docs/html/guide/topics/resources/localization.jd @@ -433,8 +433,8 @@ application, however, should localize properly.</p> <p>To change the locale in the emulator by using the adb shell. </p>
<ol>
- <li>Pick the locale you want to test and determine its language and region codes, for
-example <code>fr</code> for French and <code>CA</code> for Canada.<br>
+ <li>Pick the locale you want to test and determine its BCP-47 language tag, for
+example, Canadian French would be <code>fr-CA</code>.<br>
</li>
<li>Launch an emulator.</li>
<li>From a command-line shell on the host computer, run the following
@@ -444,16 +444,14 @@ command:<br> the <code>-e</code> option:<br>
<code>adb -e shell</code></li>
<li>At the adb shell prompt (<code>#</code>), run this command: <br>
- <code>setprop persist.sys.language [<em>language code</em>];setprop
-persist.sys.country [<em>country code</em>];stop;sleep 5;start <br>
+ <code>setprop persist.sys.locale [<em>BCP-47 language tag</em>];stop;sleep 5;start <br>
</code>Replace bracketed sections with the appropriate codes from Step
1.</li>
</ol>
<p>For instance, to test in Canadian French:</p>
-<p><code>setprop persist.sys.language fr;setprop persist.sys.country
-CA;stop;sleep 5;start </code></p>
+<p><code>setprop persist.sys.locale fr-CA;stop;sleep 5;start </code></p>
<p>This will cause the emulator to restart. (It will look like a full reboot,
but it is not.) Once the Home screen appears again, re-launch your application (for
diff --git a/docs/html/guide/topics/search/searchable-config.jd b/docs/html/guide/topics/search/searchable-config.jd index 9d2fa94..4874bb4 100644 --- a/docs/html/guide/topics/search/searchable-config.jd +++ b/docs/html/guide/topics/search/searchable-config.jd @@ -329,7 +329,7 @@ user is entering query text. This is added to the <dt><a name="suggestActionMsg"></a><code>android:suggestActionMsg</code></dt> <dd><em>String</em>. An action message to be sent if the action key is pressed while a suggestion is in focus. This is added to the - intent that that the system passes to your searchable activity (using the action + intent that the system passes to your searchable activity (using the action you've defined for the suggestion). To examine the string, use {@link android.content.Intent#getStringExtra getStringExtra(SearchManager.ACTION_MSG)}. This should only be used if all your diff --git a/docs/html/images/gp-dff-appinfo.png b/docs/html/images/gp-dff-appinfo.png Binary files differindex 30f58b8..a436b46 100644 --- a/docs/html/images/gp-dff-appinfo.png +++ b/docs/html/images/gp-dff-appinfo.png diff --git a/docs/html/reference/com/google/android/gms/fitness/data/Field.html b/docs/html/reference/com/google/android/gms/fitness/data/Field.html index b20df58..91bf861 100644 --- a/docs/html/reference/com/google/android/gms/fitness/data/Field.html +++ b/docs/html/reference/com/google/android/gms/fitness/data/Field.html @@ -2208,35 +2208,35 @@ From interface - + <tr class="alt-color api apilevel-" > <td class="jd-typecol"><nobr> abstract - - - - + + + + int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad">describeContents</span>()</nobr> - + </td></tr> - + <tr class=" api apilevel-" > <td class="jd-typecol"><nobr> abstract - - - - + + + + void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad">writeToParcel</span>(Parcel arg0, int arg1)</nobr> - + </td></tr> diff --git a/docs/html/reference/com/google/android/gms/location/LocationRequest.html b/docs/html/reference/com/google/android/gms/location/LocationRequest.html index f943d83..d051d41 100644 --- a/docs/html/reference/com/google/android/gms/location/LocationRequest.html +++ b/docs/html/reference/com/google/android/gms/location/LocationRequest.html @@ -2776,7 +2776,7 @@ From interface <p>This interval is inexact. You may not receive updates at all (if no location sources are available), or you may receive them slower than requested. You may also receive them faster than requested (if other applications are requesting location at a faster interval). - The fastest rate that that you will receive updates can be controlled with + The fastest rate that you will receive updates can be controlled with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code>. By default this fastest rate is 6x the interval frequency. <p>Applications with only the coarse location permission may have their interval silently diff --git a/docs/html/tools/debugging/ddms.jd b/docs/html/tools/debugging/ddms.jd index d2fb47a..1b59875 100644 --- a/docs/html/tools/debugging/ddms.jd +++ b/docs/html/tools/debugging/ddms.jd @@ -140,7 +140,7 @@ parent.link=index.html <li>Click <strong>Get Allocations</strong> to see a list of objects that have been allocated since you clicked on the <strong>Start Tracking</strong> button. You can click on <strong>Get - Allocations</strong> again to append to the list new objects that that have been + Allocations</strong> again to append to the list new objects that have been allocated.</li> <li>To stop tracking or to clear the data and start over, click the <strong>Stop Tracking diff --git a/docs/html/tools/help/hprof-conv.jd b/docs/html/tools/help/hprof-conv.jd index f96def2..982f337 100644 --- a/docs/html/tools/help/hprof-conv.jd +++ b/docs/html/tools/help/hprof-conv.jd @@ -8,9 +8,13 @@ The <code>hprof-conv</code> tool converts the HPROF file that is generated by the Android SDK tools to a standard format so you can view the file in a profiling tool of your choice. </p> -<pre> hprof-conv <infile> <outfile></pre> +<pre> hprof-conv [-z] <infile> <outfile></pre> <p> You can use "-" for <code><infile></code> or <code><outfile></code> to specify stdin or stdout. </p> + +<p> +You can use "-z" to filter out zygote allocations shared by all applications. +</p> diff --git a/docs/html/tools/support-library/features.jd b/docs/html/tools/support-library/features.jd index 0f0a0c0..ee1ed72 100644 --- a/docs/html/tools/support-library/features.jd +++ b/docs/html/tools/support-library/features.jd @@ -205,9 +205,12 @@ com.android.support:multidex:1.0.0 information on using the Action Bar, see the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide. </li> - <li>{@link android.support.v7.app.ActionBarActivity} - Adds an application activity class that - must be used as a base class for activities that uses the Support Library action bar - implementation. + <li>{@link android.support.v7.app.AppCompatActivity} - Adds an application activity class that can + be used as a base class for activities that use the Support Library action bar + implementation. + </li> + <li>{@link android.support.v7.app.AppCompatDialog} - Adds a dialog class that can be used as a base + class for AppCompat themed dialogs. </li> <li>{@link android.support.v7.widget.ShareActionProvider} - Adds support for a standardized sharing action (such as email or posting to social applications) that can be included in an diff --git a/docs/html/tools/support-library/index.jd b/docs/html/tools/support-library/index.jd index 56a3954..1aef0c1 100644 --- a/docs/html/tools/support-library/index.jd +++ b/docs/html/tools/support-library/index.jd @@ -62,6 +62,211 @@ page.title=Support Library <div class="toggle-content opened"> <p id="rev21"><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt="" +/>Android Support Library, revision 22.1.0</a> <em>(April 2015)</em> + </p> + <div class="toggle-content-toggleme"> + <dl> + <dt>Changes for <a href="features.html#v4">v4 support library:</a></dt> + <dd> + <ul> + + <li>Added the {@link android.support.v4.graphics.ColorUtils ColorUtils} class + to provide a set of color-related utility methods. + </li> + <li>Added the {@link android.support.v4.graphics.drawable.DrawableCompat#unwrap unwrap()} and + {@link android.support.v4.graphics.drawable.DrawableCompat#wrap wrap()} methods to the + {@link android.support.v4.graphics.drawable.DrawableCompat} class , allowing you to use + {@link android.support.v4.graphics.drawable.DrawableCompat#setTint setTint()}, + {@link android.support.v4.graphics.drawable.DrawableCompat#setTintList setTintList()}, + and {@link android.support.v4.graphics.drawable.DrawableCompat#setTintMode setTintMode()} + on all API level 4 or higher devices. + </li> + <li>Added the {@link android.support.v4.os.TraceCompat} class to + write trace events to the system trace buffer, which can then be collected and + visualized using the <a href="{@docRoot}tools/help/systrace.html">Systrace</a> tool. + </li> + <li>Added the {@link android.support.v4.util.CircularIntArray} class + to create circular integer array data structures. + </li> + <li>Added the {@link android.support.v4.util.CircularArray#clear clear()}, + {@link android.support.v4.util.CircularArray#removeFromStart removeFromStart()}, + and {@link android.support.v4.util.CircularArray#removeFromEnd removeFromEnd()} + methods to the {@link android.support.v4.util.CircularArray} class. Also, changed the + existing methods in this class to be non-final. + </li> + <li>Added the {@link android.support.v4.view.InputDeviceCompat} + as a helper class to access data in the + {@link android.support.v4.view.InputDeviceCompat} class. + </li> + <li>Added the {@link android.support.v4.view.LayoutInflaterCompat} + class as a helper class to access data in the + {@link android.support.v4.view.LayoutInflaterCompat} class + and added the {@link android.support.v4.view.LayoutInflaterFactory} interface. + </li> + <li>Added classes, methods, and interfaces to support nested scrolling. + <ul> + <li>Added the {@link android.support.v4.view.NestedScrollingChildHelper} + and {@link android.support.v4.view.NestedScrollingParentHelper} + helper classes for implementing nested scrolling parent and child views.</li> + <li>Added the {@link android.support.v4.view.NestedScrollingChild} + interface to be implemented by {@link android.view.View} subclasses.</li> + <li>Added the {@link android.support.v4.view.NestedScrollingParent} + and {@link android.support.v4.view.ScrollingView} interfaces to support + scrolling operations and provide scroll related APIs.</li> + <li>Added the + {@link android.support.v4.view.ViewGroupCompat#getNestedScrollAxes + getNestedScrollAxes()} method to the {@link android.support.v4.view.ViewGroupCompat} + class.</li> + <li>Added methods to the {@link android.support.v4.view.ViewParentCompat} class to + support nested scrolling. + </li> + <li>Added the {@link android.support.v4.widget.NestedScrollView} + class to support nested scrolling parent and child on both new and old versions of + Android. + </li> + </ul> + </li> + <li>Added methods and constants to the {@link android.support.v4.view.MotionEventCompat} + class for getting axis values and event source. + </li> + <li>Updated the {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} + class to add methods for errors, content invalidation and labels. + </li> + <li>Added the following interpolation classses for animation: + {@link android.support.v4.view.animation.FastOutLinearInInterpolator}, + {@link android.support.v4.view.animation.FastOutSlowInInterpolator}, + {@link android.support.v4.view.animation.LinearOutSlowInInterpolator}, + {@link android.support.v4.view.animation.LinearOutSlowInInterpolator}, and + {@link android.support.v4.view.animation.PathInterpolatorCompat}. + </li> + <li>Added the {@link android.support.v4.widget.Space} class to create gaps between + components in general purpose layouts. This class is deprecated in the gridlayout library. + </li> + <li>Added the {@link android.support.v4.widget.TextViewCompat} class for accessing + features in a {@link android.widget.TextView}. + </li> + <li>Added a displacement parameter to the + {@link android.support.v4.widget.EdgeEffectCompat#onPull onPull()} method in the + {@link android.support.v4.widget.EdgeEffectCompat} class. + </li> + + </ul> + </dd> + + + <dt>Changes for <a href="features.html#v7-appcompat">v7 appcompat library</a>:</dt> + <dd> + <ul> + <li>Added tint support to appcompat widgets, including + {@link android.support.v7.widget.AppCompatAutoCompleteTextView}, + {@link android.support.v7.widget.AppCompatButton}, + {@link android.support.v7.widget.AppCompatCheckBox}, + {@link android.support.v7.widget.AppCompatCheckedTextView}, + {@link android.support.v7.widget.AppCompatEditText}, + {@link android.support.v7.widget.AppCompatMultiAutoCompleteTextView}, + {@link android.support.v7.widget.AppCompatRadioButton}, + {@link android.support.v7.widget.AppCompatRatingBar}, + {@link android.support.v7.widget.AppCompatSpinner}, and + {@link android.support.v7.widget.AppCompatTextView}. + </li> + <li>Updated the {@link android.support.v7.app.AppCompatActivity} as the base + class for activities that use the support library action bar features. This class + replaces the deprecated {@link android.support.v7.app.ActionBarActivity}. + </li> + <li>Added the + {@link android.support.v7.app.AppCompatCallback} interface + to be implemented for AppCompat to be able to perform callbacks. + </li> + <li>Added the + {@link android.support.v7.app.AppCompatDelegate} abstract class + as a delegate you can use to extend AppCompat's support to any activity. + </li> + <li>Added the + {@link android.support.v7.app.AppCompatDialog} class + as the base class for AppCompat themed dialogs. + </li> + <li>Added the spinner style + {@link android.support.v7.app.AlertDialog} and + {@link android.support.v7.app.AlertDialog.Builder} classes to provide an AppCompat + themed {@link android.app.AlertDialog}. + </li> + <li>Added the {@link android.support.v7.graphics.Palette.Builder} class + for generating {@link android.support.v7.graphics.Palette} instances. + <ul> + <li>Added the + {@link android.support.v7.graphics.Palette#from} + method to the {@link android.support.v7.graphics.Palette} class to + start generating a Palette with the returned + {@link android.support.v7.graphics.Palette.Builder} instance. + </li> + <li>Deprecated the {@link android.support.v7.graphics.Palette#generate generate()} and + {@link android.support.v7.graphics.Palette#generateAsync generateAsync()} methods. + </li> + </ul> + </li> + + <li>Added the + {@link android.support.v7.widget.GridLayout.Spec#getAbsoluteAlignment + getAbsoluteAlignment()} method to the {@link android.support.v7.widget.GridLayout.Spec} + class. + </li> + <li>Deprecated use of <code>app:theme</code> for styling + {@link android.support.v7.widget.Toolbar}. You can now use + <code>android:theme</code> for toolbars on all API level 7 and higher devices and + <code>android:theme</code> support for all widgets on API level 11 and higher devices. + </li> + </ul> + </dd> + + + <dt>Changes for <a href="features.html#v17-leanback">v17 leanback library</a>:</dt> + <dd> + <ul> + <li> Added {@link android.support.v17.leanback.app.GuidedStepFragment}, + {@link android.support.v17.leanback.widget.GuidanceStylist} and + {@link android.support.v17.leanback.widget.GuidedActionsStylist} to support + creating multi-step decision flows. + </li> + </ul> + </dd> + + + <dt>Changes for <a href="features.html#v7-recyclerview">v7 recyclerview library</a>:</dt> + <dd> + <ul> + <li>Added {@link android.support.v7.util.SortedList} classes to display items in + a list order and provide notification of changes to the list. + </li> + <li>Added the {@link android.support.v7.widget.util.SortedListAdapterCallback} class + that can bind a sorted list to a + {@link android.support.v7.widget.RecyclerView.Adapter} class. + </li> + </ul> + </dd> + + + <dt>Changes for v8 renderscript library:</dt> + <dd> + <ul> + <li>Added the {@link android.support.v8.renderscript.ScriptIntrinsicHistogram} class for + use as a histogram filter.</li> + <li>Added the {@link android.support.v8.renderscript.ScriptIntrinsicResize} class for + performing a resize of a 2D allocation. + </li> + </ul> + </dd> + + </dl> + + + </div> +</div> <!-- end of collapsible section --> + + + +<div class="toggle-content closed"> + <p id="rev21"><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Android Support Library, revision 22</a> <em>(March 2015)</em> </p> <div class="toggle-content-toggleme"> @@ -159,6 +364,10 @@ page.title=Support Library </ul> </dd> + </div> +</div> + + <div class="toggle-content closed"> @@ -1113,4 +1322,3 @@ Android 3.2 and higher (all other APIs in the v4 library are already available w <p>Initial release with the v4 library.</p> </div> </div> - diff --git a/docs/html/tools/testing/testing_eclipse.jd b/docs/html/tools/testing/testing_eclipse.jd index 7d3be47..6c9d55b 100644 --- a/docs/html/tools/testing/testing_eclipse.jd +++ b/docs/html/tools/testing/testing_eclipse.jd @@ -218,7 +218,7 @@ from Eclipse</a>. <p> Another useful convention is to add the method <code>testPreconditions()</code> to your test class. Use this method to test that the application under test is initialized correctly. If this - test fails, you know that that the initial conditions were in error. When this happens, further + test fails, you know that the initial conditions were in error. When this happens, further test results are suspect, regardless of whether or not the tests succeeded. </p> <p> diff --git a/docs/html/tools/testing/testing_otheride.jd b/docs/html/tools/testing/testing_otheride.jd index 9484158..a774087 100644 --- a/docs/html/tools/testing/testing_otheride.jd +++ b/docs/html/tools/testing/testing_otheride.jd @@ -281,7 +281,7 @@ $ android create test-project -m ../HelloAndroid -n HelloAndroidTest -p HelloAnd <p> Another useful convention is to add the method <code>testPreConditions()</code> to your test class. Use this method to test that the application under test is initialized correctly. If this - test fails, you know that that the initial conditions were in error. When this happens, further + test fails, you know that the initial conditions were in error. When this happens, further test results are suspect, regardless of whether or not the tests succeeded. </p> <p> diff --git a/docs/html/training/wearables/data-layer/accessing.jd b/docs/html/training/wearables/data-layer/accessing.jd index 0c0a2d5..482b30c 100644 --- a/docs/html/training/wearables/data-layer/accessing.jd +++ b/docs/html/training/wearables/data-layer/accessing.jd @@ -61,13 +61,16 @@ GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) </pre> <p class="caution"> -<strong>Important:</strong> To avoid client connection errors on devices that do not have the +<strong>Important:</strong> If you are adding multiple APIs to a +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code>GoogleApiClient</code></a>, +you may run into client connection errors on devices that do not have the <a href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> installed, use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access only the <a +Wear app</a> installed. To avoid connection errors, call the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApiIfAvailable(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>, com.google.android.gms.common.api.Scope...)">{@code addApiIfAvailable()}</a> +method and pass in the <a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API. For more information, see <a +Wearable}</a> API to indicate that your client should gracefully handle the missing API. +For more information, see <a href="{@docRoot}google/auth/api-client.html#WearableApi">Access the Wearable API</a>.</p> <p>Before you use the data layer API, start a connection on your client by calling the diff --git a/docs/html/training/wearables/data-layer/messages.jd b/docs/html/training/wearables/data-layer/messages.jd index 0826e6b..ef9bfb1 100644 --- a/docs/html/training/wearables/data-layer/messages.jd +++ b/docs/html/training/wearables/data-layer/messages.jd @@ -10,6 +10,12 @@ page.title=Sending and Receiving Messages <li><a href="#SendMessage">Send a Message</a></li> <li><a href="#ReceiveMessage">Receive a Message</a></li> </ol> +<h2>Try it out</h2> +<ul> + <li> + <a href="https://github.com/googlesamples/android-FindMyPhone/" class="external-link">FindMyPhone</a> + </li> +</ul> </div> </div> @@ -28,7 +34,7 @@ such as sending a message to the wearable to start an activity.</p> <p>Multiple wearable devices can be connected to a user’s handheld device. Each connected device in the network is considered a <em>node</em>. With multiple connected devices, you must consider which -nodes receive the messages. For example, In a voice transcription app that receives voice data on +nodes receive the messages. For example, in a voice transcription app that receives voice data on the wearable device, you should send the message to a node with the processing power and battery capacity to handle the request, such as a handheld device.</p> @@ -138,6 +144,19 @@ private void setupVoiceTranscription() { } </pre> +<p class="note"><strong>Note:</strong> +If you create a service that extends +<a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code>WearableListenerService</code></a> +to detect capability changes, you may want to override the +<a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onConnectedNodes(java.util.List<com.google.android.gms.wearable.Node>)"><code>onConnectedNodes()</code></a> +method to listen to finer-grained connectivity details, such as when a wearable device switches +from Wi-Fi to a Bluetooth connection to the handset. For an example implementation, see the +<code>DisconnectListenerService</code> class in the +<a href="https://github.com/googlesamples/android-FindMyPhone/" class="external-link">FindMyPhone</a> +sample. For more information on how to listen for important events, see +<a href="{@docRoot}training/wearables/data-layer/events.html#Listen">Listen for Data Layer Events</a>. +</p> + <p>After detecting the capable nodes, determine where to send the message. You should pick a node that is in close proximity to your wearable device to minimize message routing through multiple nodes. A nearby node is defined as one that is directly @@ -177,7 +196,15 @@ class.</p> <p>The following example shows how to send a message to the transcription-capable node from a wearable device. Verify that the node is available before you attempt to send the message. This call -is synchronous and blocks processing until the message is received or until the request times out. +is synchronous and blocks processing until the system queues the message for delivery. +</p> + +<p class="note"><strong>Note:</strong> A successful result code does not guarantee delivery of the +message. If your app requires data reliability, use +<a href="{@docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a> +objects or the +<a href="{@docRoot}reference/com/google/android/gms/wearable/ChannelApi.html"><code>ChannelApi</code></a> +class to send data between devices. </p> <pre> diff --git a/docs/html/wear/design/index.jd b/docs/html/wear/design/index.jd index 247cc87..e01d17f 100644 --- a/docs/html/wear/design/index.jd +++ b/docs/html/wear/design/index.jd @@ -164,7 +164,7 @@ Notifications</a>.</p> <img src="{@docRoot}wear/images/circle_voice_B.png" height="200" style="float:right;margin:0 0 20px 40px" /> <img src="{@docRoot}wear/images/circle_voice_A.png" height="200" style="float:right;margin:0 0 20px 40px" /> -<p>Voice replies are primarily used by messaging applications to provide a hands-free way of dictating a short message. You can also provide a up to five suggested replies or “canned responses” that are useful in a wide range of cases. These canned responses can be tapped by the user, allowing for a fast method of sending simple replies in cases where speaking may not be desirable.</p> +<p>Voice replies are primarily used by messaging applications to provide a hands-free way of dictating a short message. You can also provide up to five suggested replies or “canned responses” that are useful in a wide range of cases. These canned responses can be tapped by the user, allowing for a fast method of sending simple replies in cases where speaking may not be desirable.</p> <p>You should attempt to cover a range of simple, neutral replies in your choices. Longer voice replies may be automatically truncated in the Voice reply UI.</p> |
