Let's say I provide 2-in-1 app: free and paid version. If user paid, then he gets additional functions available in the application.
To simplify the task and understanding, I took sample application. Then, I've added one more button to the main screen (this is our 'paid' function) - this button is disabled by default. If user paid for Potion (in the sample application), then this button should be enabled.
So, the following questions I have:
myButton.setEnabled(true)
to
onPurchaseStateChange / if
(purchaseState ==
PurchaseState.PURCHASED)
only.
Also, I need to have this button
enabled after application start if user
paid. Should I do it in
restoreDatabase
? Do I need to call
this restoreDatabase
in
onStart()
also?RESTORE_TRANSACTIONS
. Then based
on result either show warning and
disable button, or allow further
actions.Usage of AndroidBillingLibrary simplifies the task.