How to add Google in-app purchase?
This guide will show you how to add Google in-app purchases to you project.
1.) Let's create an IDs for Google purchases.
I'm doing something like this:
*com.yousite - you package name
com.yousite.iap1 - for buy 30 credits
com.yousite.iap2 - for buy 70 credits
com.yousite.iap3 - for buy 120 credits
save constants - in BalanceActivity.java file (ITEM_SKU_1 = "com.yousite.iap1"; ITEM_SKU_2 = "com.yousite.iap2"; ITEM_SKU_3 = "com.yousite.iap3")
Remember!
a) 5,6,7,8,9,10 steps you need to perform 3 times! For (step 6) com.yousite.iap1, com.yousite.iap2, com.yousite.iap3!
b) Purchases does not work if the application does not published in Google Play and is not installed on your device from Google Play!
c) You can not make purchases in your own app! Use a different Google Account for testing!
d) To test purchases (without using real money), you can activate "GOOGLE_PAY_TEST_BUTTON = true" in Constants.java
I'm doing something like this:
*com.yousite - you package name
com.yousite.iap1 - for buy 30 credits
com.yousite.iap2 - for buy 70 credits
com.yousite.iap3 - for buy 120 credits
save constants - in BalanceActivity.java file (ITEM_SKU_1 = "com.yousite.iap1"; ITEM_SKU_2 = "com.yousite.iap2"; ITEM_SKU_3 = "com.yousite.iap3")
Remember!
a) 5,6,7,8,9,10 steps you need to perform 3 times! For (step 6) com.yousite.iap1, com.yousite.iap2, com.yousite.iap3!
b) Purchases does not work if the application does not published in Google Play and is not installed on your device from Google Play!
c) You can not make purchases in your own app! Use a different Google Account for testing!
d) To test purchases (without using real money), you can activate "GOOGLE_PAY_TEST_BUTTON = true" in Constants.java

2.) Select "Services & APIs" and copy IN-APP BILLING (Selected on screenshot) to Constants.java (BILLING_KEY)

3.) Go to https://play.google.com/apps/publish
Create a application and upload your apk
Create a application and upload your apk
4.) Select you application

5.) Select "In-app Products"

6.) Select " Add new product"

7.) Enter data and click "Continue"

8.) Click "Add price"

9.) Enter data and click "Apply"

10.) Enter data and click "Activate"
