3

I have one question in my mind that can we test the in-app purchase application in Google Apis emulator with different api level?

Any information regarding this will be welcomed.

Rushabh Patel
  • 3,052
  • 4
  • 26
  • 58

4 Answers4

6

You cannot test services like in app billing and LVL on emulators as they lack Google Play, which acts as a middleman between your app and then launch Google servers. Additionally, the accounts you can configure on the emulator are limited in functionality.

See this for details on testing.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • 1
    thanks for your time and information. also one thing i want to ask you is that the link you have mentioned in that, one example is there to explain those things so from where i can get that example with code? – Rushabh Patel Sep 05 '12 at 14:15
  • 1
    The example is Downloaded to your machine when you use the sdk manager to download the in app billing component. – Raghav Sood Sep 05 '12 at 14:17
  • That depends on where you installed the sdk, so I can't. – Raghav Sood Sep 05 '12 at 14:20
3

No, you can't. There's a way to test you in-app billing, but it's something you have to install on a real device, not the emulator:

http://developer.android.com/guide/google/play/billing/billing_testing.html

"To test in-app billing in an application you must install the application on an Android-powered device. You cannot use the Android emulator to test in-app billing."

Shivan Dragon
  • 15,004
  • 9
  • 62
  • 103
  • ok thanks for the information you have mentioned. Now where can I download the android in-app purchase example that android developer site is talking about in the [developer.android.com](http://developer.android.com/guide/google/play/billing/billing_integrate.html#billing-download) ? – Rushabh Patel Sep 05 '12 at 14:13
  • Well, I'm only gonna guess here, as I never did this, but if you get the latest Android SDK you should find it among the samples that come with it. – Shivan Dragon Sep 05 '12 at 14:18
1

I know of this open-source library project called android-test-billing who apparently lets you test IAB in the emulator by recreating the Google Play Billing Service.

I haven't tried it myself, though.

hpique
  • 119,096
  • 131
  • 338
  • 476
1

Yes, You can test. Login into Google play with google account. Now purchase the in-app products.

Ankur_009
  • 3,823
  • 4
  • 31
  • 47
  • The purchase made in an emulator device will be a Sandbox Purchase or it will be a real purchase . Can you please confirm? – Kamal Jul 15 '21 at 10:26