3

I'm testing an app on my phone with a developer account and with test items (android.test.purchased). When I call the isBillingSupported() method, my ResponseCode is RESULT_DEVELOPER_ERROR. I didn't publish the app on the market, but I read that it is unnecessary because I use android.test.purchased.

<uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.READ_OWNER_DATA"/>
    <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/>        
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>  
    <uses-permission android:name="com.android.vending.BILLING"/>

I uploaded it on the market as a draft, and still no luck... I'm losing my nerve...

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
Jovan
  • 1,741
  • 4
  • 19
  • 38
  • I wonder why you got a -1, I just +1 you. Since in-app billing is tough to get working. All kinds of errors pop up. I wonder if a hello world will help http://mcondev.wordpress.com/2011/06/26/integrate-in-app-billing-just-3-lines-of-code-in-your-app/ – Siddharth Oct 26 '12 at 07:46
  • Yes, I know... :) Thanks for +1...i finaly get it working... Thanks again Siddharth – Jovan Oct 26 '12 at 08:11
  • What did you do to get it working, take a few minutes and update the group. Thanks. – Siddharth Oct 26 '12 at 08:40
  • I'm sorry but i don't remember...that was over a year ago...sorry...but i do remember that the right answer from above helped me, but there was something else... :((( – Jovan Nov 20 '12 at 07:53

2 Answers2

3

To answer the questions in your comments to @Samir's answer:

"my question is do i need to sign an app for release"

Yes, you do.

"do i need to publish on market???"

No, you don't.

Bart
  • 19,692
  • 7
  • 68
  • 77
guydemossyrock
  • 1,118
  • 9
  • 16
  • Don't forget you do need to *upload* to the market, and your the APK you're testing needs to have the same version code as the market APK, according to http://stackoverflow.com/a/10622748/580677 – nmr Dec 18 '13 at 18:27
0

Make sure your package name is correct.

Although you will eventually need to have the app signed for release (how to do this), you should be able to call isBillingSupported()WITHOUT signing the app, and have it return RESULT_OKas long as you have the BILLING permission on AND your package name is the same exact one for your app. I was using a different, hard coded package name, and isBillingSupported()was returning RESULT_DEVELOPER_ERROR.

So here is my working code that calls isBillingSupported():

String packageName = context.getPackageName();

try
{
    IInAppBillingService service = activity.getBillingService();
    int response = service.isBillingSupported(3, packageName, "inapp");
    Log.i("mylogtag", "response: " + response);
}
catch (RemoteException re)
{
    re.printStackTrace();
}
ubzack
  • 1,878
  • 16
  • 16