summaryrefslogtreecommitdiffstats
path: root/docs/html/google/play
diff options
context:
space:
mode:
authorDirk Dougherty <ddougherty@google.com>2014-08-04 17:33:25 -0700
committerDirk Dougherty <ddougherty@google.com>2014-09-04 09:30:59 -0700
commit555439ca97b2a0e796c13b0718b1bea60593c7a0 (patch)
tree4b0955a49891c6e8a641a466793b6ec23086260a /docs/html/google/play
parent1014b9aa491d4d7dd4d4fc2510e7b6e6b3b4654d (diff)
downloadframeworks_base-555439ca97b2a0e796c13b0718b1bea60593c7a0.zip
frameworks_base-555439ca97b2a0e796c13b0718b1bea60593c7a0.tar.gz
frameworks_base-555439ca97b2a0e796c13b0718b1bea60593c7a0.tar.bz2
Doc change: Add note to use explicit intent when binding to billing service.
Change-Id: I820d7aa88b5951736224d358a3a9d3f0caac6956
Diffstat (limited to 'docs/html/google/play')
-rw-r--r--docs/html/google/play/billing/api.jd3
-rw-r--r--docs/html/google/play/billing/billing_integrate.jd25
-rw-r--r--docs/html/google/play/billing/billing_reference.jd2
-rw-r--r--docs/html/google/play/billing/billing_subscriptions.jd4
-rw-r--r--docs/html/google/play/billing/billing_testing.jd1
-rw-r--r--docs/html/google/play/billing/index.jd2
-rw-r--r--docs/html/google/play/billing/versions.jd1
7 files changed, 22 insertions, 16 deletions
diff --git a/docs/html/google/play/billing/api.jd b/docs/html/google/play/billing/api.jd
index 3d46715..bc710f9 100644
--- a/docs/html/google/play/billing/api.jd
+++ b/docs/html/google/play/billing/api.jd
@@ -1,6 +1,7 @@
-page.title=In-app Billing Version 3
+page.title=In-app Billing API
parent.title=In-app Billing
parent.link=index.html
+page.tags="billing, inapp, iap"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index dba43cd..052cf75 100644
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -1,6 +1,7 @@
-page.title=Implementing In-app Billing <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=Implementing In-app Billing
parent.title=In-app Billing
parent.link=index.html
+page.tags="inapp, billing, iap"
@jd:body
<div id="qv-wrapper">
@@ -141,15 +142,17 @@ ServiceConnection mServiceConn = new ServiceConnection() {
};
</pre>
-<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created.</p>
-<pre>
-&#64;Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- bindService(new
- Intent("com.android.vending.billing.InAppBillingService.BIND"),
- mServiceConn, Context.BIND_AUTO_CREATE);
+<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created, and explicitly set the Intent's target package name to <code>com.android.vending</code> &mdash; the package name of Google Play app.</p>
+
+<p class="caution"><strong>Caution:</strong> To protect the security of billing transactions, always make sure to explicitly set the intent's target package name to <code>com.android.vending</code>, using {@link android.content.Intent#setPackage(java.lang.String) setPackage()} as shown in the example below. Setting the package name explicitly ensures that <em>only</em> the Google Play app can handle billing requests from your app, preventing other apps from intercepting those requests.</p>
+
+<pre>&#64;Override
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
+ serviceIntent.setPackage("com.android.vending");
+ bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
</pre>
<p>You can now use the mService reference to communicate with the Google Play service.</p>
<p class="note"><strong>Important:</strong> Remember to unbind from the In-app Billing service when you are done with your {@link android.app.Activity}. If you don’t unbind, the open service connection could cause your device’s performance to degrade. This example shows how to perform the unbind operation on a service connection to In-app Billing called {@code mServiceConn} by overriding the activity’s {@link android.app.Activity#onDestroy onDestroy} method.</p>
@@ -269,7 +272,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
}
</pre>
-<p class="note"><strong>Security Recommendation:</strong> When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
+<p class="note"><strong>Security Recommendation:</strong> When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
<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” or "subs").</p>
diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
index 4f5e65c..4d80964 100644
--- a/docs/html/google/play/billing/billing_reference.jd
+++ b/docs/html/google/play/billing/billing_reference.jd
@@ -1,4 +1,4 @@
-page.title=In-app Billing Reference <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=In-app Billing Reference
parent.title=In-app Billing
parent.link=index.html
@jd:body
diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd
index 3c72da1..2b78ab3 100644
--- a/docs/html/google/play/billing/billing_subscriptions.jd
+++ b/docs/html/google/play/billing/billing_subscriptions.jd
@@ -1,9 +1,9 @@
-page.title=Google Play In-App Subscriptions
+page.title=In-App Subscriptions
parent.title=In-app Billing
parent.link=index.html
page.metaDescription=Subscriptions let you sell content or features in your app with automated, recurring billing.
page.image=/images/play_dev.jpg
-page.tags="inapp, iap, billing"
+page.tags="subscriptions, billing, inapp, iap"
meta.tags="monetization, inappbilling, subscriptions"
@jd:body
diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
index 8a49433..10f5326 100644
--- a/docs/html/google/play/billing/billing_testing.jd
+++ b/docs/html/google/play/billing/billing_testing.jd
@@ -1,6 +1,7 @@
page.title=Testing In-app Billing
parent.title=In-app Billing
parent.link=index.html
+page.tags="inapp, billing, iap"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd
index 18b1523..875271f 100644
--- a/docs/html/google/play/billing/index.jd
+++ b/docs/html/google/play/billing/index.jd
@@ -2,7 +2,7 @@ page.title=Google Play In-app Billing
page.metaDescription=In-app Billing lets you sell digital content as one-time purchases or subscriptions.
page.image=/images/play_dev.jpg
meta.tags="monetizing, inappbilling, subscriptions"
-page.tags="inapp, iap, subscriptions"
+page.tags="billing, inapp, iap"
@jd:body
<p>In-app Billing is a Google Play service that lets you sell digital content from inside
diff --git a/docs/html/google/play/billing/versions.jd b/docs/html/google/play/billing/versions.jd
index 1271a15..dbe3ea3 100644
--- a/docs/html/google/play/billing/versions.jd
+++ b/docs/html/google/play/billing/versions.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
page.title=In-app Billing Version Notes
@jd:body