An improved design that makes applications simpler to write, debug and maintain. Integrations that previously required several hundred lines of code can now be implemented in as few as 50.

More robust architecture resulting in fewer lost transactions.

Local caching for faster API calls.

Long-anticipated functionality such as the ability to consume managed purchases and query for product information.

In-app Billing version 3 is available now and lets you sell both in-app items and (since February 2013) subscriptions, including subscriptions with free trials. It is supported by Android 2.2+ devices running the latest version of the Google Play Store (over 90% of active devices).

Easier to Implement

Bundle bundle = mService.getBuyIntent(3, "com.example.myapp", MY_SKU, ITEM_TYPE_INAPP, developerPayload); PendingIntent pendingIntent = bundle.getParcelable(RESPONSE_BUY_INTENT); if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) { // Start purchase flow (this brings up the Google Play UI). // Result will be delivered through onActivityResult(). startIntentSenderForResult(pendingIntent, RC_BUY, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0)); }

public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == RC_BUY) { int responseCode = data.getIntExtra(RESPONSE_CODE); String purchaseData = data.getStringExtra(RESPONSE_INAPP_PURCHASE_DATA); String signature = data.getStringExtra(RESPONSE_INAPP_SIGNATURE); // handle purchase here (for a permanent item like a premium upgrade, // this means dispensing the benefits of the upgrade; for a consumable // item like "X gold coins", typically the application would initiate // consumption of the purchase here) } }

Local Caching

Bundle bundle = mService.getPurchases(3, mContext.getPackageName(), ITEM_TYPE_INAPP); if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) { ArrayList mySkus, myPurchases, mySignatures; mySkus = bundle.getStringArrayList(RESPONSE_INAPP_ITEM_LIST); myPurchases = bundle.getStringArrayList(RESPONSE_INAPP_PURCHASE_DATA_LIST); mySignatures = bundle.getStringArrayList(RESPONSE_INAPP_PURCHASE_SIGNATURE_LIST); // handle items here }

Product Information

Bundle bundle = mService.getSkuDetails(3, "com.example.myapp", ITEM_TYPE_INAPP, skus); // skus is a Bundle with the list of SKUs to query if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) { List detailsList = bundle.getStringArrayList(RESPONSE_SKU_DETAILS_LIST); for (String details : detailsList) { // details is a JSON string with // SKU details (title, description, price, ...) } }

Sample Application

App-Specific Keys

Get Started!