From 7ed189e457b16c06b0425bd28aeeb1df5c8ff5b8 Mon Sep 17 00:00:00 2001
From: Scott Kennedy The registration ID lasts until the Android application explicitly unregisters
itself, or until Google refreshes the registration ID for your Android application. Note: 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 Note: 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
-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.com.google.android.c2dm.intent.RECEIVE
intents. At that point, you server should mark the device as unregistered (the server will receive a NotRegistered
error).
+com.google.android.c2dm.intent.RECEIVE
intents. At that point, your server should mark the device as unregistered (the server will receive a NotRegistered
error).
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.
Bundle skuDetails = mService.getSkuDetails(3, - getPackageName(), “inapp”, querySkus); + getPackageName(), "inapp", querySkus);
If the request is successful, the returned {@link android.os.Bundle}has a response code of {@code BILLING_RESPONSE_RESULT_OK} (0).
Warning: 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.
@@ -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; } } @@ -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 In-app Billing Reference. Next, extract a {@link android.app.PendingIntent} from the response {@link android.os.Bundle} with key {@code BUY_INTENT}.-PendingIntent pendingIntent = buyIntentBundle.getParcelable(“BUY_INTENT”); +PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
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.
@@ -206,7 +206,7 @@ startIntentSenderForResult(pendingIntent.getIntentSender(), "purchaseTime":1345678900000, "purchaseState":0, "developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ", - “purchaseToken”:“rojeslcdyyiapnqcynkjyyjh” + "purchaseToken":"rojeslcdyyiapnqcynkjyyjh" }' @@ -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) {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”).
-Bundle ownedItems = mService.getPurchases(3, getPackageName(), “inapp”, null); +Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);
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.
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.
diff --git a/docs/html/google/play/expansion-files.jd b/docs/html/google/play/expansion-files.jd index 271c192..d2ab509 100644 --- a/docs/html/google/play/expansion-files.jd +++ b/docs/html/google/play/expansion-files.jd @@ -684,7 +684,7 @@ procedures:The Downloader Library includes some APIs in the {@code Helper} class to help with this process:
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:
+it to {@link android.content.Context#bindService bindService()}. For example:Intent intent = new Intent(this, LocalService.class); @@ -667,7 +667,7 @@ Below, figure 1 illustrates the logic for this kind of lifecycle. and also allows binding. -For more information about the lifecycle of an started service, see the For more information about the lifecycle of a started service, see the Services document.
diff --git a/docs/html/guide/topics/location/strategies.jd b/docs/html/guide/topics/location/strategies.jd index f790953..404b797 100644 --- a/docs/html/guide/topics/location/strategies.jd +++ b/docs/html/guide/topics/location/strategies.jd @@ -202,7 +202,7 @@ accuracy. android.location.LocationManager#requestLocationUpdates requestLocationUpdates()}:-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}:-LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER; +String locationProvider = LocationManager.NETWORK_PROVIDER; // Or use LocationManager.GPS_PROVIDER Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider); diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd index cd88ae9..380ab15 100644 --- a/docs/html/guide/topics/resources/layout-resource.jd +++ b/docs/html/guide/topics/resources/layout-resource.jd @@ -264,7 +264,7 @@ guide.public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView.(R.layout.main_activity); + setContentView(R.layout.main_activity); }@@ -279,4 +279,4 @@ public void onCreate(Bundle savedInstanceState) { - \ No newline at end of file + diff --git a/docs/html/guide/topics/resources/string-resource.jd b/docs/html/guide/topics/resources/string-resource.jd index da410a4..27761e2 100644 --- a/docs/html/guide/topics/resources/string-resource.jd +++ b/docs/html/guide/topics/resources/string-resource.jd @@ -177,7 +177,7 @@ ID to reference the array.
<item>
For more information about implementing and testing accessibility, see Making Applications Accessible.
+For more information about implementing and testing accessibility, see Making Applications Accessible.
Note: To identify the non-accessible components in the UI, click on the Toggle NAF Nodes option in the {@code uiautomatorviewer} tool.
-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 Making Applications Accessible.
+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 Making Applications Accessible.
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:
diff --git a/docs/html/training/basics/location/geocoding.jd b/docs/html/training/basics/location/geocoding.jd index 6364976..3192d14 100644 --- a/docs/html/training/basics/location/geocoding.jd +++ b/docs/html/training/basics/location/geocoding.jd @@ -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; } } - \ No newline at end of file + diff --git a/docs/html/training/in-app-billing/purchase-iab-products.jd b/docs/html/training/in-app-billing/purchase-iab-products.jd index d5f6634..7fa77d3 100644 --- a/docs/html/training/in-app-billing/purchase-iab-products.jd +++ b/docs/html/training/in-app-billing/purchase-iab-products.jd @@ -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 } } diff --git a/docs/html/training/multiple-threads/create-threadpool.jd b/docs/html/training/multiple-threads/create-threadpool.jd index 4a4ddb1..e22afd3 100644 --- a/docs/html/training/multiple-threads/create-threadpool.jd +++ b/docs/html/training/multiple-threads/create-threadpool.jd @@ -46,7 +46,7 @@ trainingnavtop=truesynchronized
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
-
+
Processes and Threads API guide.
diff --git a/docs/html/training/notepad/notepad-ex2.jd b/docs/html/training/notepad/notepad-ex2.jd
index 1334d7a..895a071 100644
--- a/docs/html/training/notepad/notepad-ex2.jd
+++ b/docs/html/training/notepad/notepad-ex2.jd
@@ -100,7 +100,7 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuIn
Now that the we've registered our ListView for a context menu and defined our context menu item, we need +
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
onContextItemSelected()
method like this: