Merge "docs: Fix a bunch of issues" into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
083426980d
@@ -90,7 +90,7 @@ public class AlertDialog extends Dialog implements DialogInterface {
|
||||
|
||||
/**
|
||||
* Special theme constant for {@link #AlertDialog(Context, int)}: use
|
||||
* the device's default alert theme with a dark background.
|
||||
* the device's default alert theme with a light background.
|
||||
*/
|
||||
public static final int THEME_DEVICE_DEFAULT_LIGHT = 5;
|
||||
|
||||
|
||||
@@ -139,9 +139,9 @@ public final class DeviceAdminInfo implements Parcelable {
|
||||
public static final int USES_POLICY_DISABLE_CAMERA = 8;
|
||||
|
||||
/**
|
||||
* A type of policy that this device admin can use: disables use of keyguard widgets.
|
||||
* A type of policy that this device admin can use: disables use of keyguard features.
|
||||
*
|
||||
* <p>To control this policy, the device admin must have a "disable-keyguard-widgets"
|
||||
* <p>To control this policy, the device admin must have a "disable-keyguard-features"
|
||||
* tag in the "uses-policies" section of its meta-data.
|
||||
*/
|
||||
public static final int USES_POLICY_DISABLE_KEYGUARD_FEATURES = 9;
|
||||
|
||||
@@ -117,7 +117,7 @@ import android.util.Slog;
|
||||
*
|
||||
* <ul>
|
||||
* <li><p>The Intent namespace is global. Make sure that Intent action names and
|
||||
* other strings are written in a namespace you own, or else you may inadvertantly
|
||||
* other strings are written in a namespace you own, or else you may inadvertently
|
||||
* conflict with other applications.
|
||||
* <li><p>When you use {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)},
|
||||
* <em>any</em> application may send broadcasts to that registered receiver. You can
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface SensorEventListener {
|
||||
*
|
||||
* <p><b>NOTE:</b> The application doesn't own the
|
||||
* {@link android.hardware.SensorEvent event}
|
||||
* object passed as a parameter and therefore cannot hold on o it.
|
||||
* object passed as a parameter and therefore cannot hold on to it.
|
||||
* The object may be part of an internal pool and may be reused by
|
||||
* the framework.
|
||||
*
|
||||
|
||||
@@ -4695,7 +4695,8 @@ public final class ContactsContract {
|
||||
* The content:// style URI for this table. Append the phone number you want to lookup
|
||||
* to this URI and query it to perform a lookup. For example:
|
||||
* <pre>
|
||||
* Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, Uri.encode(phoneNumber));
|
||||
* Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
|
||||
* Uri.encode(phoneNumber));
|
||||
* </pre>
|
||||
*/
|
||||
public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* <p>A popup window that can be used to display an arbitrary view. The popup
|
||||
* windows is a floating container that appears on top of the current
|
||||
* window is a floating container that appears on top of the current
|
||||
* activity.</p>
|
||||
*
|
||||
* @see android.widget.AutoCompleteTextView
|
||||
|
||||
@@ -3501,7 +3501,7 @@
|
||||
<attr name="calendarViewShown" format="boolean" />
|
||||
<!-- The minimal date shown by this calendar view in mm/dd/yyyy format. -->
|
||||
<attr name="minDate" format="string" />
|
||||
<!-- The minimal date shown by this calendar view in mm/dd/yyyy format. -->
|
||||
<!-- The maximal date shown by this calendar view in mm/dd/yyyy format. -->
|
||||
<attr name="maxDate" format="string" />
|
||||
<!-- @hide The layout of the date picker. -->
|
||||
<attr name="internalLayout" format="reference" />
|
||||
|
||||
@@ -208,9 +208,9 @@ ID in a database. </li>
|
||||
<p>The registration ID lasts until the Android application explicitly unregisters
|
||||
itself, or until Google refreshes the registration ID for your Android application.</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
|
||||
<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, your server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
|
||||
<p>
|
||||
Note that it might take a few minutes for the registration ID to be completed removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p>
|
||||
Note that it might take a few minutes for the registration ID to be completely removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p>
|
||||
</p>
|
||||
|
||||
<h4 id="push-process">Sending a Message</h4>
|
||||
@@ -593,7 +593,7 @@ have an application server that meets the following criteria:</p>
|
||||
<ul>
|
||||
<li>Able to communicate with your client.</li>
|
||||
<li>Able to fire off HTTPS requests to the GCM server.</li>
|
||||
<li>Able to handle requests and resend then as needed, using <a href="http://en.wikipedia.org/wiki/Exponential_backoff">exponential back-off.</a></li>
|
||||
<li>Able to handle requests and resend them as needed, using <a href="http://en.wikipedia.org/wiki/Exponential_backoff">exponential back-off.</a></li>
|
||||
<li>Able to store the API key and client registration IDs. The
|
||||
API key is included in the header of POST requests that send
|
||||
messages.</li>
|
||||
|
||||
@@ -149,7 +149,7 @@ querySkus.putStringArrayList(“ITEM_ID_LIST”, skuList);
|
||||
<p>To retrieve this information from Google Play, call the {@code getSkuDetails} method on the In-app Billing Version 3 API, and pass the method the In-app Billing API version (“3”), the package name of your calling app, the purchase type (“inapp”), and the {@link android.os.Bundle} that you created.</p>
|
||||
<pre>
|
||||
Bundle skuDetails = mService.getSkuDetails(3,
|
||||
getPackageName(), “inapp”, querySkus);
|
||||
getPackageName(), "inapp", querySkus);
|
||||
</pre>
|
||||
<p>If the request is successful, the returned {@link android.os.Bundle}has a response code of {@code BILLING_RESPONSE_RESULT_OK} (0).</p>
|
||||
<p class="note"><strong>Warning:</strong> Do not call the {@code getSkuDetails} method on the main thread. Calling this method triggers a network request which could block your main thread. Instead, create a separate thread and call the {@code getSkuDetails} method from inside that thread.</p>
|
||||
@@ -169,8 +169,8 @@ if (response == 0) {
|
||||
JSONObject object = new JSONObject(thisResponse);
|
||||
String sku = object.getString("productId");
|
||||
String price = object.getString("price");
|
||||
if (sku.equals(“premiumUpgrade”)) mPremiumUpgradePrice = price;
|
||||
else if (sku.equals(“gas”)) mGasPrice = price;
|
||||
if (sku.equals("premiumUpgrade")) mPremiumUpgradePrice = price;
|
||||
else if (sku.equals("gas")) mGasPrice = price;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
@@ -186,7 +186,7 @@ Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
|
||||
If the request is successful, the returned {@link android.os.Bundle} has a response code of {@code BILLING_RESPONSE_RESULT_OK} (0) and a {@link android.app.PendingIntent} that you can use to start the purchase flow. To see all the possible response codes from Google Play, see <a href="{@docRoot}google/play/billing/billing_reference.html#billing-codes">In-app Billing Reference</a>. Next, extract a {@link android.app.PendingIntent} from the response {@link android.os.Bundle} with key {@code BUY_INTENT}.
|
||||
</p>
|
||||
<pre>
|
||||
PendingIntent pendingIntent = buyIntentBundle.getParcelable(“BUY_INTENT”);
|
||||
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
|
||||
</pre>
|
||||
<p>
|
||||
To complete the purchase transaction, call the {@link android.app.Activity#startIntentSenderForResult startIntentSenderForResult} method and use the {@link android.app.PendingIntent} that you created. In this example, you are using an arbitrary value of 1001 for the request code.</p>
|
||||
@@ -206,7 +206,7 @@ startIntentSenderForResult(pendingIntent.getIntentSender(),
|
||||
"purchaseTime":1345678900000,
|
||||
"purchaseState":0,
|
||||
"developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
|
||||
“purchaseToken”:“rojeslcdyyiapnqcynkjyyjh”
|
||||
"purchaseToken":"rojeslcdyyiapnqcynkjyyjh"
|
||||
}'
|
||||
</pre>
|
||||
</p>
|
||||
@@ -217,8 +217,8 @@ startIntentSenderForResult(pendingIntent.getIntentSender(),
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == 1001) {
|
||||
int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
|
||||
String purchaseData = data.getStringExtra(“INAPP_PURCHASE_DATA”);
|
||||
String dataSignature = data.getStringExtra(“INAPP_DATA_SIGNATURE”);
|
||||
String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
|
||||
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
try {
|
||||
@@ -240,7 +240,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
<h3 id="QueryPurchases">Querying for Purchased Items</h3>
|
||||
<p>To retrieve information about purchases made by a user from your app, call the {@code getPurchases} method on the In-app Billing Version 3 service. Pass in to the method the In-app Billing API version (“3”), the package name of your calling app, and the purchase type (“inapp”).</p>
|
||||
<pre>
|
||||
Bundle ownedItems = mService.getPurchases(3, getPackageName(), “inapp”, null);
|
||||
Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);
|
||||
</pre>
|
||||
<p>The Google Play service returns only the purchases made by the user account that is currently logged in to the device. If the request is successful, the returned {@link android.os.Bundle} has a response code of 0. The response {@link android.os.Bundle} also contains a list of the product IDs, a list of the order details for each purchase, and the signatures for each purchase.</p>
|
||||
<p>To improve performance, the In-app Billing service returns only up to 700 products that are owned by the user when {@code getPurchase} is first called. If the user owns a large number of products, Google Play includes a String token mapped to the key {@code INAPP_CONTINUATION_TOKEN} in the response {@link android.os.Bundle} to indicate that more products can be retrieved. Your application can then make a subsequent {@code getPurchases} call, and pass in this token as an argument. Google Play continues to return a continuation token in the response {@link android.os.Bundle} until all products that are owned by the user has been sent to your app.</p>
|
||||
|
||||
@@ -684,7 +684,7 @@ procedures:</p>
|
||||
<p>The Downloader Library includes some APIs in the {@code Helper} class to
|
||||
help with this process:</p>
|
||||
<ul>
|
||||
<li>{@code getExtendedAPKFileName(Context, c, boolean mainFile, int
|
||||
<li>{@code getExpansionAPKFileName(Context, c, boolean mainFile, int
|
||||
versionCode)}</li>
|
||||
<li>{@code doesFileExist(Context c, String fileName, long fileSize)}</li>
|
||||
</ul>
|
||||
|
||||
@@ -691,7 +691,7 @@ restored, by default).</p>
|
||||
android.app.Activity#onSaveInstanceState onSaveInstanceState()} helps save the state of the UI, if
|
||||
you override the method in order to save additional state information, you should always call the
|
||||
superclass implementation of {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
|
||||
before doing any work. Likewise, you should also call the supercall implementation of {@link
|
||||
before doing any work. Likewise, you should also call the superclass implementation of {@link
|
||||
android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} if you override it, so the
|
||||
default implementation can restore view states.</p>
|
||||
|
||||
@@ -773,4 +773,4 @@ android.app.Activity#onStop onStop()}.</p>
|
||||
enables user multitasking, continue with the <b><a
|
||||
href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back
|
||||
Stack</a></b> document.</p>
|
||||
-->
|
||||
-->
|
||||
|
||||
@@ -578,7 +578,7 @@ private ServiceConnection mConnection = new ServiceConnection() {
|
||||
</pre>
|
||||
|
||||
<p>With this {@link android.content.ServiceConnection}, the client can bind to a service by passing
|
||||
this it to {@link android.content.Context#bindService bindService()}. For example:</p>
|
||||
it to {@link android.content.Context#bindService bindService()}. For example:</p>
|
||||
|
||||
<pre>
|
||||
Intent intent = new Intent(this, LocalService.class);
|
||||
@@ -667,7 +667,7 @@ Below, figure 1 illustrates the logic for this kind of lifecycle.</p>
|
||||
and also allows binding.</p>
|
||||
|
||||
|
||||
<p>For more information about the lifecycle of an started service, see the <a
|
||||
<p>For more information about the lifecycle of a started service, see the <a
|
||||
href="{@docRoot}guide/components/services.html#Lifecycle">Services</a> document.</p>
|
||||
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ accuracy.</p>
|
||||
android.location.LocationManager#requestLocationUpdates requestLocationUpdates()}:</p>
|
||||
|
||||
<pre>
|
||||
LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
|
||||
String locationProvider = LocationManager.NETWORK_PROVIDER;
|
||||
// Or, use GPS location data:
|
||||
// LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
|
||||
|
||||
@@ -217,7 +217,7 @@ long for users wait. Until a more accurate location is provided to your location
|
||||
should utilize a cached location by calling {@link
|
||||
android.location.LocationManager#getLastKnownLocation}:</p>
|
||||
<pre>
|
||||
LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
|
||||
String locationProvider = LocationManager.NETWORK_PROVIDER;
|
||||
// Or use LocationManager.GPS_PROVIDER
|
||||
|
||||
Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
|
||||
|
||||
@@ -264,7 +264,7 @@ guide.
|
||||
<pre>
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView.(R.layout.main_activity);
|
||||
setContentView(R.layout.main_activity);
|
||||
}
|
||||
</pre>
|
||||
</dd> <!-- end example -->
|
||||
@@ -279,4 +279,4 @@ public void onCreate(Bundle savedInstanceState) {
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</dl>
|
||||
|
||||
@@ -177,7 +177,7 @@ ID to reference the array.</dd>
|
||||
|
||||
</dd>
|
||||
<dt id="string-array-item-element"><code><item></code></dt>
|
||||
<dd>A string, which can include styling tags. The value can be a referenced to another
|
||||
<dd>A string, which can include styling tags. The value can be a reference to another
|
||||
string resource. Must be a child of a {@code <string-array>} element. Beware that you
|
||||
must escape apostrophes and
|
||||
quotation marks. See <a href="#FormattingAndStyling">Formatting and Styling</a>, below, for
|
||||
|
||||
@@ -292,7 +292,7 @@ href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/c
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lenevo</td>
|
||||
<td>Lenovo</td>
|
||||
<td><a href="http://developer.lenovomm.com/developer/download.jsp"
|
||||
>http://developer.lenovomm.com/developer/download.jsp</a>
|
||||
</td>
|
||||
|
||||
@@ -141,11 +141,11 @@ If you are connected to only a single device, you do not need to set the ANDROID
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p>
|
||||
<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p>
|
||||
|
||||
<p class="note"><strong>Note: </strong>To identify the non-accessible components in the UI, click on the <strong>Toggle NAF Nodes</strong> option in the {@code uiautomatorviewer} tool.</p>
|
||||
|
||||
<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p>
|
||||
<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p>
|
||||
|
||||
<h3 id="configure">Configure your development environment</h3>
|
||||
<p>If you're developing in Eclipse, the Android SDK provides additional tools that help you write test cases using {@code uiautomator} and buiild your JAR file. In order to set up Eclipse to assist you, you need to create a project that includes the {@code uiautomator} client library, along with the Android SDK library. To configure Eclipse:</p>
|
||||
|
||||
@@ -82,7 +82,7 @@ private class ReverseGeocodingTask extends AsyncTask<Location, Void, Void>
|
||||
// Update UI field with the exception.
|
||||
Message.obtain(mHandler, UPDATE_ADDRESS, e.toString()).sendToTarget();
|
||||
}
|
||||
if (addresses != null &s;&s; addresses.size() > 0) {
|
||||
if (addresses != null && addresses.size() > 0) {
|
||||
Address address = addresses.get(0);
|
||||
// Format the first line of address (if available), city, and country name.
|
||||
String addressText = String.format("%s, %s, %s",
|
||||
@@ -95,4 +95,4 @@ private class ReverseGeocodingTask extends AsyncTask<Location, Void, Void>
|
||||
return null;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
@@ -65,7 +65,7 @@ IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
|
||||
else if (purchase.getSku().equals(SKU_GAS)) {
|
||||
// consume the gas and update the UI
|
||||
}
|
||||
else (purchase.getSku().equals(SKU_PREMIUM)) {
|
||||
else if (purchase.getSku().equals(SKU_PREMIUM)) {
|
||||
// give user access to premium content and update the UI
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ trainingnavtop=true
|
||||
<code>synchronized</code> block. This approach will prevent one thread from reading the variable
|
||||
while another is writing to it. Typically, this situation arises with static variables, but it
|
||||
also occurs in any object that is only instantiated once. To learn more about this, read the
|
||||
<a href="{@docRoot}http://developer.android.com/guide/components/processes-and-threads.html">
|
||||
<a href="{@docRoot}guide/components/processes-and-threads.html">
|
||||
Processes and Threads</a> API guide.
|
||||
|
||||
</p>
|
||||
|
||||
@@ -100,7 +100,7 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuIn
|
||||
</ol>
|
||||
|
||||
<h2>Step 3</h2>
|
||||
<p>Now that the we've registered our ListView for a context menu and defined our context menu item, we need
|
||||
<p>Now that we've registered our ListView for a context menu and defined our context menu item, we need
|
||||
to handle the callback when it is selected. For this, we need to identify the list ID of the
|
||||
selected item, then delete it. So fill in the
|
||||
<code>onContextItemSelected()</code> method like this:</p>
|
||||
|
||||
Reference in New Issue
Block a user