1

I'm developing an Android app which should be free to use for a certain period. When the phase of free use ends the user should register and pay to be able to use the app furthermore.

No I wondering how I could archive this, as the user might simply re-install the app to extend the period of free use. So I need a way to identify the user in such a way that he cannot pretend to be someone else or a new user. At the same time I want to avoid that the user has to do any registration if possible before the free use period ends.

At the moment I think about identify the user by his telephone number or SIM card id as he probably won't buy a new SIM card only to be able the use the app for free. The disadvantage of this is that this is limited to devices which are phones so any WIFI tablet won't be able to use the app as it doesn't have a SIM card.

Are there any other options to archive this behavior?

Flo
  • 27,355
  • 15
  • 87
  • 125

4 Answers4

1

What you want to do is to track installations. This can be done by getting a unique id and then saving it using shared preferences. You could put this into a folder on the SD-card but I don't think I'm the only one getting annoyed by this kind of behaviour in apps. Rather than putting a file on the SD-card want to backup the file using BackupManger and uploading it to the cloud.

You can find info about the BackupManager here: Data backup

and a short part of this video on tracking installations here, 16:30 min in: Google I/O 2011: Pro tips

I really recommend you (all) to watch the video as it goes through many rookie and pro misstakes.

When reading about the BackupManager you'll find out that, just as all the other solutions, it wont work on all devices. I don't think this will be a big concern of yours, it will be a small group of people who can work around your trial period ending but there will always be. Spend time on developing your app and making it better instead.

softarn
  • 5,327
  • 3
  • 40
  • 54
  • Mh, I don't think that I really want to track installations as this would allow the user to put his SIM card in another phone and re install the app and use it again for free. – Flo Jul 17 '11 at 12:39
  • Those who will do that is an extremly small portion of users which you can/should ignore. If you want to include 100% of your users, you WILL fail. Blizzard and DICE can't even do this, do you think you can? – softarn Jul 17 '11 at 13:05
0

You might want to read this post from the Android Developers blog. They recommend the ANDROID-ID, though it has it's downsides.

  • No they don't. They recommend you to track installations. But if you for some reason want to try tracking devices, you should use ANDROID-ID. In this case, as nearly always, we're better off tracking the installation. – softarn Jul 17 '11 at 12:11
  • Yeah thats the summary from the post. But how do you track installations and prevent the "re-install the app to extend the period of free use"? You have to distinguish between two seperate users with a single installation and one user trying to do the above. So you have to get some information that this user already had an install of your app. Probably some ID? (I might be on the wrong path here (and hopefully learn something), but if this is the case, please provide some more information. This comment alone does not help.) –  Jul 17 '11 at 13:09
0

You might want to try:

import android.provider.Settings.System;

..

String android_id = System.getString(this.getContentResolver(), System.ANDROID_ID);

Although some devices apparently return the same value for this, which I think is contradictory to what the API docs say. It's possibly useful to use this as a secondary check.

However do try to take caution in sending personal details such as IMEI or phone number etc back to your server as users rightfully get a little anxious about such things being broadcast. You could always do a hash of the IMEI (if accessible, can't remember off the top of my head) and add this to the ANDROID_ID, creating something that's going to more or less be unique. Maybe hash some other detail in addition to this to really guarantee uniqueness as hashes can and will clash.

Rasel
  • 15,499
  • 6
  • 40
  • 50
  • 1
    This is not a good approach, just as you say yourself in your answer, and it requires a permission to get the IMEI which you can't really motivate. Users will find this disturbing and rate it lower or don't download it at all. You should be really carefull requesting permissions! – softarn Jul 17 '11 at 11:24
  • This is the good approch, Android ID is present on all devices and identifies the user in an unique way. Indeed, I don't recommend the use of IMEI, because it is not present on all devices, like tablets. – Climbatize Jul 17 '11 at 23:44
  • "it is not 100% reliable on releases of Android prior to 2.2 (“Froyo”). Also, there has been at least one widely-observed bug in a popular handset from a major manufacturer, where every instance has the same ANDROID_ID." from http://android-developers.blogspot.com/2011/03/identifying-app-installations.html Also Android ID does not identify the user, it identifies the device. – softarn Jul 18 '11 at 09:39
-1

Is there a unique Android device ID?

Most voted answer (Joe's) in above is the best approach I have found so far.

Community
  • 1
  • 1
tarkeshwar
  • 4,105
  • 4
  • 29
  • 35