2

From the doc , it said

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.

But anyone have success in testing with Android x86 VM (http://www.android-x86.org)?

I suppose the VM should act like a real device and should be okay to test?

Top-Master
  • 7,611
  • 5
  • 39
  • 71
Howard
  • 19,215
  • 35
  • 112
  • 184
  • Does this answer your question? [How to test In-app Billing on an emulator?](https://stackoverflow.com/questions/26100032/how-to-test-in-app-billing-on-an-emulator) – Top-Master Nov 18 '22 at 17:11

2 Answers2

5

The actual platform doesn't really matter. IAB uses the Android Market/Play store application to provide its services, so if you have that installed and properly working, you will be able to test. If not, you won't. Since the IAB code is platform-independent, you don't really need to test it on all platforms you need to support.

Update 2022; However, OP asks about android-x86 project, because the Android-Emulator's standard system-images (those provided by Google) do somehow notify Google-Wallet and/or Google-Pay app, that they are under Emulator, which causes said apps to NOT even allow adding payment-method.

See How to test In-app Billing on an emulator?

This behavior is required, because else any restricted country could switch to Emulator.

Top-Master
  • 7,611
  • 5
  • 39
  • 71
Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
  • that is a big *if* though, I dont think Android-x86 has any plans to support Google market/play specifically – Jordan Jun 25 '12 at 22:44
  • Nikolay is correct, you can install Google apps in your x86 emulator and then you can do the inapp billing test. – tszming Jun 27 '12 at 05:18
1

I found this project

Allows you to test in app billing applications directly from the emulator by simply adding a library and redirecting requests to a stub.

However I was not able to integrate this library with the sample code in extras/google/play_billing/

It would be very useful to write a step by step how to for the integration of this project in the sample code.

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Antonello
  • 321
  • 1
  • 3
  • 5