Learn how to launch the purchase flow for subscription purchases.
- [Instructor] Let's go ahead and add the code…to implement purchase flow for for subscriptions.…Let's go back up to line 175.…I'm going to add a new method called launchIapSubscription…and it will take an activity,…so a pass in dialog, get.OwnerActivity…and we're going to paste in the SKU that the user selected.…In this case it will be BuildConfig.SKU_Subscription_monthly…If you have more than one subscription SKU,…then you can add a variable…to keep track of the user selection.…
In other words, if you have multiple SKUs here,…you're going to have multiple option arrays.…You can keep track of them with a separate variable…for tracking the SKU corresponding to the option…and then pass it in here.…Now let's define launchIapSubscription.…The first thing we want to do…is check that we have a valid pricing data.…
Let's go back up in here.…We'll copy subscriptionSKUPrice on line 143.…And go back into our method, launchIapSubscription…and do a string check on this.…TextUtils is empty.…If we do have a subscription SKU price,…
- 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
Android App Development: Unit Testingwith James P White2h 58m Intermediate
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.