Not install free version application on second time on same - android

I have load free version app on android market.I want to that user install app only one time on devices.Not second time.How to solve this problem in android devices.

One solution that came to my mind is set a value on SharedPreferences, though it can be erased/modified on rooted devices, and check if it's not set to call a webservice with the DEVICE_ID and check if already exists on your database, if not, add it.
With that.. if the user uninstall the application, next time he/she install it the SharedPreferences values will not be set, so when you call your webservice you'll see that the application was installed before on that device.

Related

How can my app track specific phone downloads?

I want to give free stuffs for first time users.
How am I able to track that your phone (both iOS and Android) is downloading my app for the very first time and not deleted and re-downloaded, for iOS and Android?
Make sure that you store device UDID/UUID in both cases and make a counter in backend database for install times associated with this UDID/UUID if the counter equal to one then this is first time user if more than that then this user has deleted and redownloaded the app. For iOS an additional step is required as the UDID is an generated value. You will have to save this in the keychain. Keychain won't get cleared when you uninstall the app. It will though if you reset your phone.

Need to find out, an application has installed already on the same device?

I need to implement trial period on my application. Once trial period is over,If user tries to uninstall and install the application again, for this case I had write one file on sdcard, if the user re install the application. When they open the application I had shown activation key prompt.
If the user delete the file,they can re install and use the application normally. How to solve this case. Is there any other way to hold the application install details in android device.
Note:
My application is a offline application.It won't need to connect with internet.(So there is no way to register with server).
Take of it this way. Everything you store on your phone will be able to get edited/removed/added. The best approach to this kind of problems is to use a webservice to register a device and check it's register date. However since your application is offline there is no way to do it foolproof.

Mobile app install for a fixed time

I don't know is it possible or not. I want to know how it is possible that user can install my app (android , iPhone, phonegap based) for a fixed time , may be 1 month. After 1 month, user will be unable to run the app. Then if he uninstall and try to install again for next 1 month, it would prevent him to install.
Is it possible or not? if possible how?
-Arefin
There's no 100% secure way to do what you want, but you could do something like this:
Get a unique identifier for device where app is installed. There's
NOT perfect way to get this identifier, but here are some options:
Is there a unique Android device ID?
Make your app connect to your server and register that identifier
Your server can return whether or not your app was already installed there, so app can act accordingly.
A side effect would be that your app could not run without Internet connection, to prevent users from disconnecting from Internet to avoid this control.
You can also specify the validity option in when you're creating the keytool. The keytool is used when exporting the .apk file of an application.
Or
You could save the install date of application in Shared Preferences- that's when the app is being installed for the first time. Then check the number of days from current date and saved date, every time the app is started and allow access only if its within limits.
Removes the problem of Internet access.

Does updating app clear sharedpreferences or remove alarms set by the app?

I've published my app in google store and now I want to update it.
But I want to be assured that I don't lose stored data in my app shared preferences. I also set some alarm in my app which starts notification, and I don't want to lose them either.
I'm not sure how updating app works? does it rewrite these things? Is there anyway that I can test it before I globally publish it?
I should mention that the changes I made in this version contain some changes in manifest: I changed targetSdkVersion and minSdkVersion (It used to have minSdk=8 now I've changed it to 4 and added targetsdk=15) and I gave a process name to my alarmservice (which is an intentservice to set the alarm) but then decided to change it and it doesn't have a processname now.
Normally, the SharedPreferences(as well as other user data) will be kept during the update process, but sometimes, due to some "unknown" problem, the data may get lost, and I guess it is out of your control. So, you can simply believe that the SharedPreferences will be kept.
As for alarms, how did you set these alarms? If you set them in code, it should be 100% ok as long as you set them right in code.
Of course, the best way to test is install your updated app on your device before you push it up to the market. First, you should install your market version of app on your phone, then export your app with your market keystore on your local computer, finally, install the exported version on your phone(the installer should inform you about the update). And you can check if these settings are still there.
While exporting, the most important thing is to make sure you are using the same keystore as you use with the market version of app.
Hope this will help you.
SharedPreferences are stored and will survive updating the application. About the alarms I am not sure, sorry.
For testing your update simply install your market version on your device, set up your stuff (alarms, sharedprefs) like a normal user would do and just install the apk on your phone that you would upload to the market (signed apk!). The installing should be the same as the update your user will get...

How to determine if user is reinstalling the app on Android

I am working on adding a release notes webView when our app is installed either for the very first time or when the app is being reinstalled. My question is on the second part where the user is installing the app on top of an existing one. I thought about deleting the release notes after it is installed but it's not possible to delete a file from assets at run time. Is there a way to determine this case?
How about saving the time when the release note was last shown in SharedPreferences, and checking it against the app install time? On fresh install there will be nothing in SharedPreferences, so you know you need to show the release note.
You can get the app install time this way:
How to get app install time from android
You can use SharedPreferences, regular File IO, or an SQLite DB in your app to store persistent information, e.g. a flag indicating if the current release notes have already been displayed or not. This data will "survive" an update of your App.
These data will, however, be deleted when the App is uninstalled from the phone, but I guess that's not a problem in your case.

Categories

Resources