Android billing testing - how do I test with the test user? - android

I set up test users so that I can test that in-app billing works, but I am a bit confused by the process.
I am following the android developer billing test guide here: http://developer.android.com/guide/google/play/billing/billing_testing.html
It has a few confusing points. It says not to publish your app, but somehow I need to get the app on my phone. So how can I get an un-published app on my phone?
Also, am I supposed to make an area on the app with the 4 product ids that google reserves and try to buy those, and then once I see it works, just get rid of those buttons to buy those test products? Is that how this is meant to be done?
Thanks!!

It says not to publish your app, but somehow I need to get the app on
my phone. So how can I get an un-published app on my phone?
There's no need to publish your app to get it installed. Create a signed build (See http://developer.android.com/tools/publishing/app-signing.html). Then install it on your phone using adb install <apk name> The SAME build you must upload to your playstore dashboard. After uploading, you will see 2 options:
PUBLISH
SAVE
Click on 'SAVE'. After saving your uploaded app, you will be able to add InApp products for that app. You MUST save and publish your inapp products in order to test them.

You should upload the apk to your developer account and fill in the mandatory fields and save it without publishing it and then you can create in-app products for the application and publish it. please note that the in-app products must be published before testing billing. But you don't require to publish the application to test billing.
Try the MoVend library for Android. it supports google play in-app billing, paypal and many more.
http://www.movend.com/

How to sign an android apk file
To install it you can use adb or you can send this file by mail. Then download in the device and install it.
Check that Settings > Applications > Unknown sources is checked in the Device.
If you are having problems implementing in-app purchase I recommend you the library AndroidBillingLibrary.

Related

How to test Google Play in app purchase?

From what I understand reading This link. It appears to me that the only way to test in app purchase is to write the complete code for in app purchase. And then do a proper build. Upload it to beta release. And then download the app via the opt in link.
But how do I develop it in the first place? Am I expected to write some lines of code and then do a build and upload it? That is a huge turn around time. Is there no way for me to have some test account that I can sign in go google play (on phone) with and then just make purchases?
Currently, my code already handles the products
android.test.purchased and android.test.canceled. How do I make it so that I can test my own products Ids? Currently it just says the product you are requesting is not available.
Google allowed to test your in app purchase in for dummy products like you mentioned android.test.purchased. To test real products you must have to deploy application in beta release at least. Following article will help you in detail :
An Android Studio Google Play In-app Billing Tutorial
Hope it will help.
You need to publish your application in beta version in play store to review the application. Without reviewing your application, you cannot test app purchases. After the review you can test your application without redeploying it to play store.

How to add in app purchase in one feature of an application of android?

I have prepared an application which has several features. To one feature of them, I want to add in app purchase option. Can anyone inform me the simplest way to implement this? As far I know it can't be tested using emulator. Then How can I test it after adding this option?
you can make a test account in your developer console under setting, upload the apk with in-app billing permissions but don't publish it.
Add in-app products in developer console.
Login with the same test account you have added in developer console as primary account to your android device.
then install the signed apk into your device
and you are ready for testing
you can also refer to android.developer for more details
http://developer.android.com/google/play/billing/billing_testing.html
At last, I have implemented in app purchase in my application with the help of bellow's website which contains brief but clear explanation of in app purchase with a simple example. Possibly this site will be helpful for the novice android programmers to learn how to implement in app purchase.
techotopia-In app purchase

Android In app purchase: This version of the application is not configured for billing through Google Play

When I try to run my application with in-app billing I am getting the error: "This version of the application is not configured for billing through Google Play. Check the help center for more information".
I have the billing permission already in the Manifest file and I have a signed .apk uploaded as a draft onto Google Play and I have also installed that same signed apk onto my phone as well as i also provided productId,and already waited for more than a day for their server to upload but still getting error.
I ran to this issue a lot. I would suggest using this link
http://blog.blundell-apps.com/simple-inapp-billing-payment-v3/
keep the product ID as android.test.purchased. (Change your Base64 if you want to) set up all of your code and get you app sorted, response handling and everything else.
Then put the app in the Google Play dont publish it (Check your version number, and keep the certificate). Add your Products (As you have already done.)
I do the following then:
In Eclipse export your app with the same Certificate and version number as the one you have on the store. put it in a different folder.
Use these commands to uninstall the app from the test phone and install it:
adb uninstall com.domain.appname
and install it with this:
adb -d install /path/to/new/apk
Then run the app on the test phone.
Your test phone has to be setup with the test Google Account. if not you need to reset the phone and set it up with the test account.
If your logCat is open you should see all the logs also your app should go through with no issue.
Please let me know how you go so I can help you further.
One more thing. I set up a Google Community for my testers and add the test accounts in there so I can test on multiple devices easily. Also you can add the test account in the setting of your GooglePlay. There are lots of document for this too.
H.

In-App Billing: Adding billing on an existing published app

We have an existing app (apk v282) published in Google Play. This app doesn't have in-app products and no BILLING permission.
We have developed an upgrade version (v292) that contains in-app products and BILLING permission.
We face a problem to create the in-app products in Google Play console:
When we upload the v292 apk as a draft in Google Play console, we have two APK listed in the draft: the old and the new:
From this page, we have two alternatives:
1- Either we click on "In-app products" on the left list to create our products, we see a page saying:
To add in-app products, you need to add the BILLING permission to your
APK.
So we cannot create in-app products, probably because v282 still is in draft configuration.
2- Or, we remove the older v282 APK (that hadnt the BILLING permission), in order to leave only the new v292 in the Draft configuration. But then when clicking on "In-app products", we get a popup warning about the configuration not being saved. But there is no button to save it, only publish. Of course we don't want to publish it as it's under test.
To sum it all up: How to test in-app purchase in an application that was previously published without it?
For everyone looking for a solution to this: uploading an apk to alpha will do. So you should add billing permission to your android manifest, build a signed version and load apk to alpha. Afterwards you can configure in app purchase products without uploading an apk to production.
I had the exact same problem. What I ended up doing was uploading a new release with the new permission but without the in app billing option visible. Mine was easy as it was just a preference option to remove ads that was easy to just not show. Once published the site let me create in-app products and I was able to test with a new apk file and published that one shortly afterwards.
You have to temporary change the package name and upload new application in market (Do not need to publish ) for temporary.
Just checking in App purchase so don't choose any package name which you want to use in feature. because Each package name is unique and Google remembers all package names anyway so you could use this a reminder
And then test in that and when you get success full run in that temporary build app then you can change again your previously package name in which you want to upload your next apk and you must have to delete your old version from that and then you can create in app product now.
Now if you want to check in App purchase then you have to buy that product from different account except this account in which you are uploading your apk Dont worry you can rollback your money after checking this functionality.
I recently face this problem and I followed like this So I hope you will get some help from my experience.
I think the issue here is that the Google Play console thinks that you are trying to publish multiple apks. This is only supported if the apks are targeting different device configurations:
publishing multiple apks
I think that once you delete the previous version you will be able to activate the newer version with in-app billing. I'll be trying this out shortly and update this answer if I learn more.

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 uploaded 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.

Categories

Resources