11

I would like to use in-app billing in my android application (instead of creation 2 versions of application - free and pro). If user paid, then additional options in Preferences should be available. My application synchronizes data with website (not my). Each time synchronization happens, I would like to check if user paid or not. How should I do it?

LA_
  • 19,823
  • 58
  • 172
  • 308
  • All: my question is primary about new in-app billing functionality (with Android Market usage). So, the question is how to check with Android Market that user purchased application. – LA_ Apr 05 '11 at 15:55
  • http://stackoverflow.com/a/991120/884674 – jeet.chanchawat Oct 01 '13 at 21:50

2 Answers2

4

I think the easiest means for you would be to use Managed purchase. More on it is at http://developer.android.com/guide/market/billing/billing_admin.html#billing-purchase-type

The "manage by user account" purchase type is useful if you are selling items such as game levels or application features. These items are not transient and usually need to be restored whenever a user reinstalls your application, wipes the data on their device, or installs your application on a new device.

Update: website and API updated refer this now https://developer.android.com/google/play/billing/api.html

the100rabh
  • 4,077
  • 4
  • 32
  • 40
3

There are to many ways to do that, i will try and give you some of the most used

  1. what about user accounts? can your application support users? if it does, its practically solved with 1 user per 1 account. just add a flag to your DB for each user. this is the most secure way, its very easy to know if someone is stealing from you thats why all MMO's (like WOW) use this type of check. you can easily know if theres more then one user on an account as well

the downside is that it requires more processing and some support is case someone's account gets stolen or other user support of that kind.

  1. you can save a sort of key inside your application. and some other key on the server. if the key matches (either 1 to 1 or after some manipulation) then you have yourself a paid user, other you dont.when someone buys the application then change the key on the device.

  2. just do what you dont want to do and have 2 applications for free and paid it will probably be less work then the other 2 list above.

there are many ways of doing what you want. but i'll tell you this: most applications use method 2 but on the opposite direction, meaning serial key. i dont think your gonna create an mmo so theres no need for option 1 unless you really dont want anyone hacking your application (which i assume no matter what you do it will be hacked in todays world. i'll advice you to trust those who pay and accept those who dont)

method 3 is just easy in my opinion especialy when you want to just remove menu options, but it also creates duplicate repositories for code.

good luck. what ever you decide is good, make a theft protection, if someone wants to steal it, they will, dont fight it (even PS3 got hacked in the end)

Gleeb
  • 10,773
  • 26
  • 92
  • 135
  • Thanks for your detailed reply. My application doesn't support user accounts and I don't have my own server. I was thinking about 2 apps as well, but don't want to keep 2 copies of one application (will have to modify both, if changes would be required). – LA_ Apr 05 '11 at 15:52
  • well if you dont have access to the data on the server then its really a matter of your application either being full or free. if the server is out of your control, nothing there will be able to tell the application "your full"/"your free" what you can do with the 2 applications is to have a "config file" or registry file. and switch between them, free and full would be the same application but the registration file would be different (and mandatory) and for upgrades, the users will just have to download the registry file. is that possible for you? – Gleeb Apr 06 '11 at 06:36