Consumable Managed Products are products that can be bought multiple times such as in-game currency, game lives, power-ups, etc.
In this example, we are going to implement 4 different consumable managed products "item1", "item2", "item3", "item4"
.
AndroidManifest.xml
file.First of all, we will need to add the AIDL file to your project as clearly explained in Google Documentation here.
IInAppBillingService.aidl
is an Android Interface Definition Language (AIDL) file that defines the interface to the In-app Billing Version 3 service. You will use this interface to make billing requests by invoking IPC method calls.
After adding the AIDL file, add BILLING permission in AndroidManifest.xml
:
<!-- Required permission for implementing In-app Billing -->
<uses-permission android:name="com.android.vending.BILLING" />
Generate a signed apk, and upload it to Google Developers Console. This is required so that we can start defining our in-app products there.
Define all your products with different productID, and set a price to each one of them. There are 2 types of products (Managed Products and Subscriptions). As we already said, we are going to implement 4 different consumable managed products "item1", "item2", "item3", "item4"
.