Nikolay,

Thanks for your reply.

Concerning running launchPurchaseFlow from the UI thread.

The library we developed for IAB Version 2 runs in a separate thread as it 
handles numerous server connections before the purchase request is sent to 
Google, and after purchase results are received.

Rather than change the architecture of the library, is it possible to run 
launchPurchaseFlow on the UI thread (from the library thread)?  I recently 
discovered runOnUiThread() but am unsure if it is appropriate in this case.

On Thursday, February 28, 2013 2:18:05 PM UTC+9, Nikolay Elenkov wrote:
>
> On Thu, Feb 28, 2013 at 1:34 PM, LostDev <[email protected] <javascript:>> 
> wrote: 
>
> > 
> > Is there any easy way to maintain separation between the application and 
> our 
> > billing library? 
>
> Require the client activity to implement some interface and pass it as a 
> parameter to your library's method's as needed. It doesn't really matter 
> where you launch stuff from as long as it is using the right thread 
> (UI thread)  and context (the activity's). 
>
> Additionally, you don't really need to use IabHelper at all, you can see 
> what it does (basically connect to a remote service and call its methods, 
> sometimes in a worker thread) and implement something similar. You 
> can't skip the onActivityResult() part though. 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to