[Android] Google Play in app billing


Published on

PT.BUZOO INDONESIA is No1 Japanese offshore development company in Indonesia.
We are professional of web solution and smartphone apps. We can support Japanese, English and Indonesia.
We are hiring now at http://buzoo.co.id/

Published in: Technology, Economy & Finance
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

[Android] Google Play in app billing

  1. 1. By : Franky Wijanarko PT. BUZOO INDONESIA
  2. 2. In-app Billing is a Google Play service that lets you sell digital content from inside your applications  You can use In-app Billing to sell products as: - Standard in-app products (one-time billing), - Subscriptions, (recurring, automated billing)  Any application that you publish through Google Play can implement In-app Billing. 
  3. 3. In-app Billing version 1 March 2011  In-app Billing version 2 May 2012  In-app Billing version 3 February 2013 
  4. 4.  Managed In-app Products This means that the user's ownership of all in-app item purchases is maintained by Google Play, and your application can query the user's purchase information when needed.
  5. 5. 2 Types of Managed In-app Products : ◦ Non-consumable Items Once purchased, these items will be permanently associated to the user's Google account. An example of a non-consumable inapp product is a premium upgrade or a level pack. ◦ Consumable items Implement consumption for items that can be made available for purchase multiple times. Typically, these items provide certain temporary effects. For example, the user's in-game character might gain life points or gain extra gold coins in their inventory.
  6. 6.  Subscriptions A subscription is a product type offered in In-app Billing that lets you sell content, services, or features to users from inside your app with recurring monthly or annual billing.
  7. 7.  To implement In-app Billing in your application, you need to do the following: 1. Installing the Google Play Billing Library Check whether or not the library is installed by launching the Android SDK Manager by selecting the Eclipse Window -> Android SDK Manager menu option, scroll down to the Extras section and the Status column next to the Google Play Billing Library
  8. 8. 2. Adding Billing Permission to the Manifest File
  9. 9. 3. Adding the IInAppBillingService.aidl File to the Project
  10. 10. 4. Adding the Utility Classes to the Project
  11. 11. 5. Obtaining the Public License Key for the Application   Create new Application Click on the Services & APIs option to display the Base64encoded RSA public key for the application
  12. 12. 6. Setting Up Google Play Billing in the Application
  13. 13. After success, we can add additional code to get an inventory of stuff we own : mHelper.queryInventoryAsync(mGotInventoryListener); mGotInventoryListener -> Listener that's called when we finish querying the items and subscriptions we own
  14. 14. 7. Initiating a Google Play In-app Billing Purchase NOTE:  MainActivity.this -> A reference to the enclosing Activity instance from which the method is being called  ITEM_SKU -> The SKU that identifies the product that is being purchased  10001 -> he request code which can be any positive integer value  mPurchaseFinishedListener -> The listener method to be called when the purchase is complete  "<payload>" -> The developer payload string. This can be any string value and can be used to identify the purchase, or may be left empty
  15. 15. 8. Implementing the onActivityResult Method
  16. 16. 9. Implementing the Purchase Finished Listener If we use new Security.java, it cause a problem when using SKU testing. So we have to replace verifyPurchase function with the old version of Security.java
  17. 17. 10. Releasing the IabHelper Instance 11. Testing the In-app Billing Application
  18. 18. 12. Creating a New In-app Product      We have to upload signed APK to Google Play Developer Console. Create a new product, set the product type to Managed product, enter a Product ID (it wil be our ITEM_SKU). In the second screen enter a title, description and price for the item. Change the menu at the top of the page to Activate. Save
  19. 19. 13. Adding In-app Billing Test Accounts  Google will not allow developers to make test purchases from their own Google accounts.  In order to test in-app billing from this point on, it will be necessary to setup other Google accounts as testing accounts.  To add a test user account :  Click on the Settings icon located on the left hand side of your Google Play Developer Console home screen and on the account details screen scroll down to the License Testing section. In the Settings icon located on the left hand side of your Google Play Developer Console.  Scroll down to the License Testing.
  20. 20. As long as the application remains in draft status within the Google Play Developer console, no charges will be incurred by the user whilst testing the in-app billing Resource:  Sprix Project  http://developer.android.com/google/play/billing/index.html  http://www.techotopia.com/index.php/Integrating_Goo gle_Play_In-app_Billing_into_an_Android_Application_ %E2%80%93_A_Tutorial
  21. 21. Thank you