Learn how to launch the purchase flow for one-time purchases.
- [Instructor] Okay, now let's add in the code…for launchIapPurchase method.…This is going to be a wrapper call to the Billing Manager,…and Billing Manager will call out to initiate purchase flow.…First we need to add in some logic checks,…so let's type in if.…We want to check whether we have a valid product SKU price…before calling out to Billing Manager.…So let's pass in productSkuPrice in here.…
And if we do have a valid product SKU price,…then let's call billingManager,…and let's call the initiatePurchaseFlow method.…And we will pass in skuProductCrop,…and also call in BillingClient.SkuType.INAPP.…Now if we don't have a valid product SKU price,…let's add an else statement,…and let's create a method called handleError.…
And we're going to pass in an error string.…So let's call this "Empty product SKU price!"…Now let's go to the bottom,…and let's define our method.…There's different ways to handle this method,…but for now, let's just add in a log,…pass in the tag, and pass in our string.…Let's also call our listener, IabGateway listener,…
- 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
Skill Level Intermediate
Q: This course was updated on 07/20/2018. What changed?
A: The following topics were updated: UI setup for in-app billing, adding public key, publishing your APK to Google Play alpha, and implementing in-app billing.
Android App Development: RESTful Web Serviceswith David Gassner2h 49m Intermediate
1. UI Setup for In-App Billing
2. Understanding the Gradle Build System
3. Setting Up for In-App Billing
4. Defining In-App Products
5. Implement In-App Billing
Next steps1m 40s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.