Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which way to implement in app billing?

After reading the android documentation on their developer website, I've realized that there are two ways to set up a purchase:

  1. create an IabHelper instance with a base64 string and use it to request some purchase... in no way it mentions that I have to use a ServiceConnection to bind the the IInAppBillingService for Android.

  2. There seems to be another way where you have to create a ServiceConnection that binds to the IInAppBillingService, where you have to create a Bundle etc.

Is it possible to use only the way where I just create the IabHelperinstance and call the methods on this instance that were acquired from the trivialDrive app ?

like image 917
i_o Avatar asked Dec 04 '25 12:12

i_o


1 Answers

IABHelper internally uses ServiceConnection and binds to the service when you startSetup() on IABHelper. As docs state (http://developer.android.com/training/in-app-billing/preparing-iab-app.html), you still have to to include the .aidl file in your project for IInAppBillingService.

I strongly suggest to look for alternatives for IABHelper. Many developers (myself included) have found numerous bugs in its implementation. For example, the queryInventoryAsync implementation does not handle concurrency correctly. You will get a lot of crashes due to IABHelper if you use it.

There are numerous alternatives on GitHub.

like image 170
ranapnea Avatar answered Dec 06 '25 01:12

ranapnea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!