The application will consist of two buttons, one of which will be disabled by default. The objective of this tutorial is to create a simple application that uses the Google in-app billing system to allow consumable purchases to be made. Report this ad Creating the Example In-app Billing Project Later in this tutorial, these classes will be imported into our own application project and used to implement in-app billing. Part of this sample application is a package containing a set of convenience classes that significantly ease the process of integrating billing into an application. The folder also includes a sample application (contained within the samples sub-directory) named TrivialDrive.
Within the above SDK subfolder resides a file named IInAppBillingService.aidl which will need to be included with any projects that require Google Play billing support.
Once the download has completed, the SDK will have been installed into the sdk/extras/google/play_billing subfolder of the Android Studio installation directory (the location of which can be found in the SDK Path field at the top of the Android SDK Manager window).
If the library’s status is listed as Not Installed, select the check box next to the library and click on the Install packages... button. Once the SDK Manager has loaded, scroll down to the Extras section and check the Status column next to the Google Play Billing Library entry as shown in Figure 55-1: Check whether or not the library is installed by launching the Android SDK Manager by selecting Configure -> SDK Manager from the Android Studio welcome screen, or via the Tools -> Android -> SDK Manager menu of the main window. Installing the Google Play Billing LibraryĪ prerequisite to implementing Google Play In-app Billing is that the Google Play Billing Library be installed on the development system.
In the early days of mobile applications for operating systems such as Android and iOS, the most common method for earning revenue was to charge an upfront fee to download and install the application. Previous Table of Contents Next Generating a Signed Release APK File in Android Studio An Overview of Gradle in Android Studio