Join Albert Lo for an in-depth discussion in this video User selection for purchase, part of Android App Development: In-App Purchasing.
- Now we are ready to implement the…on click method for handling user selection.…First, I'm going to rename the dialog parameter…to dialog interface, and I'm going to rename which to ID.…This will be the ID that's passed in…when the user selects continue or the cancel button.…Now let's get a local reference to dialog.…We can do that by casting dialog interface to dialog.…
Now let's add a switch case for our ID.…The first case we want to handle…is when the user has selected option element zero.…So in this case, we are going to…set subscription selected to true.…Is subscription selected is going to be…a boolean parameter so let's select create field.…Now let's go back down.…
The next case we want to handle…is when the user selects option element one.…Option element one is when the user selects product cropped.…So I'm going to set is subscription selected to false.…The next case we will add is for when the user cancels out.…When the user cancels out, we will get back in ID,…and this will be ID for button negative.…
- 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.
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.