0

Is there a way to restrict the number of users of an android app? I want to sell an app to a third party and only give 100 liscenses of the app.

How can I do it?

Tim
  • 41,901
  • 18
  • 127
  • 145
  • Your 2nd question is off topic here (licensing). I removed it – Tim Jul 21 '16 at 15:09
  • can you use a login page? that way you have control of the list of users by giving them their credentials, and activating/deactivating users – germanio Jul 21 '16 at 15:11
  • 2
    I suppose you should use beta test to restrict users. In this way you can add as many users you want – tk1505 Jul 21 '16 at 15:13
  • the second question is off topic or not allowed to be asked in stack overflow? Shall I put it as another question? – supersmart mobility Jul 22 '16 at 07:57

1 Answers1

1

The best way to achieve this is to :

1) get the device ID (as explained here)

2) Checking that device ID and sending it to an external webserver where all the allowed devices IDs are stored.

You can implement a webservice on your Splash Activity or a Login Activity to check if the device's ID is accepted on your white list. If it is, you allow the transition to the app, if not, you display a pop-up saying that the device does not have a valid license and you finish the application

Either way, you always need a 3rd party webservice for license doublechecking.

Regards,

Community
  • 1
  • 1
Ricardo Vieira
  • 1,738
  • 1
  • 18
  • 26
  • I am trying to restrict count rather than device id. Does google provide any way or using 3rd party webservice is the only way. But how will I track uninstalls using 3rd party webservice. – supersmart mobility Jul 22 '16 at 06:51
  • You have taken the first step. Basiscally, imagine you make telephone cards for people to call and you have 100 licenses, so people need to put the card in the phone and dial a special code to you (for example 12345+the number on the back of the card you gave them) to say like "Hey, i bought you this license and I want to active my telephone card". You check the license and you see 1) the number on the back of their card is legit, so you allow them to make calls or 2) the number is fake and you prevent them from making calls. This is exactly the same behaviour you are looking for. As in – Ricardo Vieira Jul 22 '16 at 07:46
  • You create a webservice [check this link on REST webservices](http://www.tutorialspoint.com/restful/), lets say in PHP for example. Then, as your application starts, you get the device ID (which is basically the unique identifier for your application) and perform an http call ([See this link for reference. It was my main reference a few years ago when I started android development](http://www.androidhive.info/2011/10/android-login-and-registration-screen-design/) )to the service you have just created. If the deviceID is accepted, you reply back "OK" and "ERROR" or "FAIL" if not. – Ricardo Vieira Jul 22 '16 at 07:52
  • Yeah , I am thinking of using some password. After 100 password validation I will stop. So even if someone uninstalls, the license will not re revoked (nt sure if that is fair in case of apps). But that brings us to another question does google allows us to limit the usage. – supersmart mobility Jul 22 '16 at 07:55
  • Basically you can just create 100 "passwords" and give them to your users. Associate each password to each user so you know exactly which user is using which password. Google has nothing to do with the way you control the user access on your application. You control both the application (which tells "hey, im here. check my license") and the webservice (which tells "yes/no, your license is valid/invalid"). Take a look on the second link I gave you. It is one of the best examples I've come across. Good luck implementing! – Ricardo Vieira Jul 22 '16 at 08:16
  • If the answer in general was helpful, please consider accepting as the correct answer. That's the best way to indicate a post is helpful in its context. Glad I could help! – Ricardo Vieira Jul 22 '16 at 08:42
  • Device ID is problematic because it changes when the device is factory reset. So don't rely on that to forever be associated with that device. Sounds like your passcode solution is better. – nasch Jul 22 '16 at 13:36