Wednesday, February 27, 2013

[android-developers] In App Billing v3 questions

We've developed a library to hide the finer details of In App Billing in Version 2 from client applications. Now we're planning to upgrade to Version 3 and I've hit a snag.

Currently the application (Activity) using the library creates an instance of the library object and calls methods to get products available for sale, and purchase products etc. When purchasing products the library handles verifying receipts via a secure server and provisioning the purchased products etc., there is quite a bit going on behind the scenes. The library has no UI, instead it returns data to the calling application which handles all the UI operations such as listing products and displaying dialogs using response coded from our library.

There is a clear line between the application, and the library.

Now looking at Version 3 I discover this comment in iabHelper for  launchPurchaseFlow:

Initiate the UI flow for an in-app purchase. Call this method to initiate an in-app purchase,
which will involve bringing up the Google Play screen. The calling activity will be paused while
the user interacts with Google Play, and the result will be delivered via the activity's
{@link android.app.Activity#onActivityResult} method, at which point you must call
this object's {@link #handleActivityResult} method to continue the purchase flow. This method
MUST be called from the UI thread of the Activity.

Does this mean the calling activity MUST implement the onActivityResult method?  

Also can we launchPurchaseFlow from the library object (which is not an activity)?

Is there any easy way to maintain separation between the application and our billing library?

Any tips or ideas greatly appreciated.

Thanks,

 Lost



--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment