I have an application. I want to release this app in android market for free.
In my app there is purchase button.If user wants to purchase my app then click on purchase button then i want to show a billing page through android market.
I have done below example
http://developer.android.com/guide/market/billing/billing_integrate.html
I don't have any in app products just i want to purchase my app only.
In above example we got code like this
new CatalogEntry("sword_001", R.string.two_handed_sword, Managed.MANAGED),
new CatalogEntry("potion_001", R.string.potions, Managed.UNMANAGED),
So where i need to keep my app id or package name in the code for identifying purchase my app.
And also i have another doubt
In paypal for every app there will be unique id. This unique id identifies the developer and transfers amount to the developer.
Then what is for in this integration(in app purchase).
For this i kept
String base64EncodedPublicKey ="my public key here"
is it correct or anything else.
Could please guide me to solve my problem.
In this below link there is full information to implement In app billing.
http://developer.android.com/guide/market/billing/billing_integrate.html
I did small mistake i.e., i installed app in device with usb connection , not signed the apk with keystore file.
For this i faced the problem. After sign the application then i installed in phone.Now it is working well.
Related
The company I'm employed at is currently working on an app built in flutter and we are using the health package from pub.dev to request permissions to and read step data from both apple health kit and google fit, respectively. IOS is working great, with no problems. However upon setting up the google oauth2 client id's in google cloud platform, we are able to get through the step data verification process in the debug version of the app, but not in a release version of the app. We've double checked that the id we have set up for the release build has the correct package name and fingerprint, however when someone in the release build who has google fit on their phone triggers the OAuth2 request screen, and selects the google account they want to proceed with, the modal closes and the permissions status does not change. I can't tell what the issue could be since it is working fine on the debug version, but I am wondering if anyone has encountered a similar error before? Right now our app is in the verification process since health data is considered a sensitive scope to google; however upon creating the id it says that we can have 100 people approve data sharing through it before verification, so I'm not sure if it is of any consequence at the moment. Please let me know if you have any insights into this.
I have an app published in Google Play Store using my personal email id. However, we are planning to register as a startup and launch the app under a company name. When I contacted Google about this process, they said I have to remove the old app and publish it again as a new app from the new id. That would mean I will lose all the current users. Is there a way to do it without removing the old app or linking the old app to the new app? Or some way to force the users to download the update from the new publisher link?
I am not sure if this is the right place to ask this question. If it isn't can you suggest someplace where I could get an answer for this?
Apps can be transferred to another developer account without any apparent change to the end user. But if you change the app, Id like from android.app.gekkouga to android.app.startup (which is how I think the person you spoke to understood you), then you have to republish the app which by all intents and purposes is a different app, as PlayStore assigns each app a unique url based on the app's unique app id.
Is it possible to 'block/prevent' users from using an old Android app?
I mean - I've already unpublished app from Play. This means that app is not available anymore for downloading.
But I'd like to restrict users to carry on using current installed app (which has been unpublished from Play).
Is it somehow possible?
Regards,
There isn't a way to check if the app is currently published to the Play Store, however you can check if there is a new version available.
From the link above:
String response = SendNetworkUpdateAppRequest(); // Your code to do the network request
// should send the current version
// to server
if(response.equals("YES")) // Start Intent to download the app user has to manually install it by clicking on the notification
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("URL TO LATEST APK")));
Treating your users like this is not something you should do. Users have an expectation that once they have acquired an app they can keep using it, and you should respect that expectation.
But let's suppose there was a seriously good reason for doing it. Suppose your signing key and developer account had been compromised by an ex-employee, and you wanted to make sure users moved from the compromised app to a new app with a new package name.
You could then issue an update to the app which when loaded did nothing except display a message saying something like "This app is out of date and will no longer be updated. Please move to this app" and have a link to the new app in the Play store. Existing users would get the update, and while the old app is available to them, most users would not be able to get it.
As I said, this is very disrespectful behavior to your users in most situations, and I'd only recommend doing it if critical for user security.
I have a developer account and have published my app on Google Play. After that I started working on Ads and In-app-purchases. For the in-app-purchases I am using this repo: https://github.com/anjlab/android-inapp-billing-v3
I tested it first by using Androids test product id (android.test.purchased), and it worked as expected. Using that test Id, I could buy the product and could also check if the product was bought.
Then I created a merchant account using the developer console, and also added a product to it. I found the merchant ID and the product ID to be used in the app.
Instead of using the android test product id, used mine as the LICENCE_KEY and added the MERCHANT_ID (which i did not use with the test product id). Here is the BillingProcessor constructor:
bp = new BillingProcessor(MainActivity.this, LICENCE_KEY, MERCHANT_ID, MainActivity.this);
Lastly I rolled out this new apk version to alpha, and added a gmail address for another account I have in the closed alpha testers list.
Now here comes the strange part: As the new account i opted in on the alpha on my computer. In the Google Play app on the phone I switched users to the new account and downloaded my app. I checked that this was the right version and it was. I also checked that the app was in the library inside "my apps and games" for the right user. I then tried the in-app-purchase, but I get a window with a text saying "please sign in to your google account, authentication required". I have seen similar error messages on SO, but they had forgot to add emails in testers list etc. and I know thats not the case for me.
I even tried creating a brand new gmail account, added it in the testers list and then used a new phone with the brand new account just to be met by the same error message.
At this moment I have no clue what is going on, so I ask in the support chat inside the dev console. They did not know why it did not work, so I had to wait for the answer through email. days later they sent me an email and said that I should try clearing the cache and cookies for chrome on my phone. I did and still no fix.
So if anyone has experienced the same, or know any nice solutions for this it would be awesome
Rolled out app as closed beta instead of closed alpha and it works fine now. I have no Idea why :P
Now I managed to sign the apk (using Eclipse Android Tools) and adb install .. to the device for testing.
But this removed the debug function, e.g. "step over" which make problem tracing much more difficult.
Is it possible to debug the inapp billing using Eclipse?
Unfortunately I don't think there is any way to step debug, I have just been using print outputs. This is due to the fact that you have to sign your app with a release key in order for it to communicate properly with the billing service. Very annoying.
When you go through the in app billing documentation, you kinda realize that it can take substantial amount of time to understand this complex piece of technology. Most developers feel the need for a working HelloWorld, and then later play around with the builds.
I have uploaded 2 projects
The android sample project. You can download this project, and immediately run the sample. This will help you quickly debug/trace thru and figure out how the in app billing works.
A cleaned up project to help you integrate your app quickly. This can help like a library. Just integrate make your “purchase requests” on your “checkout” button action.
Mind you : I have not incorporated the security recommendations. Read android in app billing documentation. Until then you are on your own risk.
For 1
Download “http://www.4shared.com/file/f5wH3qke/InAppBilling1.html”
Create a new gmail account for all correspondence (Why, I will explain below)
Pay that 25$ and purchase a “Market Place” account.
Import the project to your eclipse environment
Create a signed application apk, File-Export-Select Your Project-Create OR Use keystore, it should be valid for 25 years from today.
Upload the signed apk to the market place as a “Draft Application”, DO NOT PUBLISH it.
For the uploaded apk, you need to add “In App Products”. You will find this link on the home page for your uploaded apk.
In Security.java dont forget to add your “public key” from your market place account “edit profile” page.
On the “In App Product List”, you need to add the following products one by one
The text below should used as “In app Product id”
sword_001 as Managed
potions_001 as Unmanaged
Title and Description dont matter (for testing purpose). Add what you need here.
Cost add 1$ (minimum)
Click auto fill
Save
Publish the in app project (dont get confused here, you only need to publish the in app product, NOT the APP)
In the test account, add your personal gmail id here. Now, this gmail account needs to be configured as your first gmail account on your phone.
Yes, this WONT work on your emulator
Now the sample app should work.
For 2
Download “http://www.4shared.com/file/h8YnJyf_/InAppBillingIntegration.html”
To integrate, in your calling activity initialize the checkout code
Handler handler = new Handler() ;
CheckoutPurchaseObserver checkout = new CheckoutPurchaseObserver(this, handler);
To send the checkout request for your product
checkout.sendCheckoutRequest(purchaseUri.toString(),null);
Important Note :
This purchaseUri is the “In-app Product ID” of your resource on the “market.android.com/publish-->Create New In-App Product” options. This string should be set as the “in app product” id.
That’s why the “id” is most important. The “In-App Product ID” is how you refer to that particular product.
Also, in Security.java dont forget to add your “public key” from your market place account “edit profile” page.**
Debugging Notes
LogCat will show all errors as InAppBilling tag
This project creates a shared_preferences named “inappbilling” And debug is set to true
The androidmanifest.xml may not be needed since this project does not
have a home screen.
Why do we need to create a new gmail account ?
Simple. The account you purchase your market place account for, cant be used for “testing” your in app billing. Since you cannot purchase products for yourself. And your primary account on your device should be set as a “test account” on the market place account. Chicken-Egg issue here. Hope its clear.
An interesting blog I came by “http://crazyviraj.blogspot.com/2011/06/some-notes-on-implementing-in-app.html“ (not mine).
In my app, I used the test product id, android.test.purchased, which will simulate the actual buying process (ie, will show the in app dialog and you'll be able to purchase and get a response that can be handled by your application). Using that product id, you can run the in app code on the device (unsigned) via eclipse over usb connection. You still might need to work around some things for testing (ie, account for the fact that you are using a testing product id and not your real id), but I found using that product ID did help me quite a bit.
See the testing section of the in app billing guide