Testing in app billing
I uploaded my signed app to the android market, I made some in app contents that I've published (but not the app). Now I trying to purchase my own products on a real device: do I need to test with the same signed .apk I uploaded to the market? Or a "normal" one I can launch with Eclipse?
Cause when I launch my app with Eclipse and send a requestPurchase(), a pop up tells me that this app version is not ready for market purchase...
You do not need to publish your application to perform end-to-end testing with real product IDs; you only need to upload your application as a draft application. However, you must sign your application with your release key before you upload it as a draft application. Also, the version number of the uploa开发者_如何学JAVAded application must match the version number of the application you load to your device for testing.
And as it's write on google's doc, the version number of the app on the market and of the app on the device are the same :/
You need to use a signed APK, the same one you uploaded to the app market.
You also need to use a different gmail account to your developer account to access the market.
There's a good tutorial here: Simple In App Billing with some alternative explanations
The testing developer guide is pretty thorough: Testing Billing Statically
You just need to sign the apk (in Eclipse : Android Tools -> Export Signed Application Package...) and reinstall it on the device (with the device attached to USB : adb install _YOUR_APK_).
There's also a way to test your app on the emulator with your own products before going to the real money : android test billing library. This library is the In-App billing implementation for the emulator, which was tested in the application Horer horaires de RER.
精彩评论