Take the 2-minute tour ×

Following are my problems:-

  1. Is it possible to get the list of applications that a user has installed, against their google account through Google Play, programmatically through the use of any api?. Please note that I am not asking about the list of apps currently installed in the device, but ones that have at some point been installed.

I need a solution to the above as I am thinking of a scenario in my app, which is:

  • I want to give my app to the user for free during the first three months, after three months if user uninstalls the app and then installs it again I want to detect through any api (from Google Play) that the user has installed the app a second time (and should not get any free usage). Please note that I don't want to use any web service to store the account id & device id of the user at my side.
share|improve this question
This is where you can start searching: code.google.com/p/android-market-api This could also be helpful : stackoverflow.com/questions/10661434/… –  userSeven7s Aug 3 '12 at 18:33

4 Answers 4

For option 2, you can create a file on the SD card. This will remain there when the user uninstalls/installs. But the user can always delete your special file. Unless you do something at your side, you are never sure if the user already used your app before.

To be completely sure, store it online: You will need to have a very simple database which holds a list of device_id that installed your app. Further more a webpage which fills this database. In your app you download/open this webpage which the webpage will fill the DB.

App > WebClient (or other) which opens http://www.example.com/registerDevice.php?device_id=. The php site fills the db.

You app will need to check the database if the current device already has installed this app inorder to work/not work. You can do this via the same php and check the response. You could for example return 'ok' or 'not ok' or something else.

share|improve this answer
This would be very unreliable method of storing the info. Sdcard may be formatted, replaced, the file deleted, etc. Even more likely in 3 months timeframe. –  Pointer Null Aug 1 '12 at 20:59
Thanks for the reply @PoweRoy. But can you please tell me what that something I have to do at my side. –  Shashank_Itmaster Aug 2 '12 at 3:53
@mice: indeed it is very unreliable –  RvdK Aug 2 '12 at 14:45
@Shashank_Itmaster: see updated answer –  RvdK Aug 2 '12 at 14:48
@PoweRoy: I got your point related to that db through php site. But in the question I have noted that point clearly. Please note that I don't want to use any web service to store the account id & device id of the user at my side. –  Shashank_Itmaster Aug 6 '12 at 3:25

The simplest method is to get the account of the user the first time he/she runs the app, and send that detail over to you. How this is can be done is well-documented over here: How to get the Android device's primary e-mail address

You will have to add another line of code to check back to the database at the first start of the app.

EDIT: For a non-web solution, simply add a timer to the start of your app:

schedule(TimerTask task, Date when)

the task should be adding a token AFTER the period of time you wish to give, to the phone's memory with the user's account details for authentication (see first solution on getting the account details)

Finally, as above, add a check-back to the phone's memory for that particular file to see if the user has used the app before.

The problem with any type of authentication that is based on the phone's memory is that people can easily remove the token, if they can find it, and reuse the app again.

share|improve this answer
Thanks @bernlim for the reply. But you have not got my point in the question which writes Please note that I don't want to use any web service to store the account id & device id of the user at my side. –  Shashank_Itmaster Aug 6 '12 at 3:22
edited for you! –  bernlim Aug 6 '12 at 5:46

Try this device specific implementation:

PackageManager packageManager = getContext().getPackageManager();
List<ApplicationInfo> applications = packageManager.getInstalledApplications(
// retrieves some information about all applications (even uninstalled ones)
// which have data directories

Of course this method won't work if user replaces the device. But you don't need to use any web service.

share|improve this answer

You can use this by keeping a database of hashed device id and users google id on a 3rd party server. Also see http://android-developers.blogspot.de/2011/03/identifying-app-installations.html

share|improve this answer

Your Answer


