This video discusses the overall structure and flow, and how to integrate In-app Billing into the application.
- [Instructor] There are two different categories of purchases for a mobile app. First there is the purchase of a physical product such as printing out of a photo for pickup or the delivery of a meal. Then there is also the purchase of a digital product. A digital product does not exist in the real physical world, but does represent some sort of perceived value. For example, it could be gold coins in a game, or access to a premium service like cropping, or it could be a subscription like a monthly access to unlimited server requests for a specific REST API endpoint.
The scope of this course deals with in-app purchases of digital products. Adding in-app billing to our app can be summarized by the following procedure. First we prepare an existing app for in-app billing. Next we set up our Google account to support in-app purchases. Next we upload an app to the Google Play console. Next we define in-app products in our Google Play Console, which we want to offer for sale in our mobile app.
Next we set up our Gradle build environment so that we can support in-app purchases. Next we implement our in-app purchase features in our Android app. And finally, we test our in-app purchase functionality. As our starting point, we will be using the app that was built as part of the course, Modern Android UI Design Elements. Please refer to that course for further details about the structure and content of the app. Here is a diagram which illustrates how this all fits together.
With the exception of IAB Library, each box here represents a component that we will build, so let's briefly review them here. First we have the product menu screens. This represents the UI that we will modify to start the in-app billing workflow. Next we have the IAB Library. This is the sample code from Google's GitHub project and it communicates directly to the Google Play services APK to handle purchases and queries. Again, we will not be building IAB Library.
Next we have the IAB Contract and this represents an abstraction to the IAB Library. Finally, we have IAB Gateway. This is an implementation of IAB Contract and will be the interface that our product menu screens talk to. Note that we will never directly talk to the IAB Library.
- Setting up an existing app for In-app Billing
- Working with the Gradle build system
- Registering a keystore
- Defining and accessing Gradle build configuration parameters from code
- Setting up a payments merchant account
- Setting up IAB test accounts
- Publishing the APK to Google Play alpha
- Defining managed products and subscription products
- Implementing In-app Billing
- Testing in-app purchases