Mobile app install for a fixed time - android

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.

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.

Is there any simple way to protect the Android App and update it?

I developed an Android App and installed to three users' cellphones through Eclipse and USB connection. I don't want to put the App to google market. Now I got two problems:
How to protect the App and make it invalid in other cellphones. I know we cannot protect it 100%, I just don't want the App to be easily copied and run on other devices. What I have done was hard coding in my program to compare the AndroidID (save the AndroidID to a string and compare with current AndroidID). The problem is that if I have 100 users, I have to hard code 100 times.
How can I keep the users updated. Do I just upload the updated App to my own server and give them the link to download and install? In this case, the first problem comes out again: how to protect the App?
The first thing in my mind is that you can set a password that app requires the first time it run after installation and give that password only to enabled users
you could make the application check for the presence of some pre-determined "key" file and distribute the file separately.
For updating the app can download new apk files and use an intent to send the user to the Package Installer so that they can choose whether or not to install.

Not install free version application on second time on same

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.

Is is possible to pass a custom argument to android market so my app receives it on first launch?

Is there a way to pass a custom argument to android market (or any other way) so my app receives the argument after it gets installed (and run for the first time).
Let me explain.
Start an intent with argument1="Hello world1" (custom argument
every
time)
Install the app from android market.
Open the app for the first time.
App shows the msg "Hello world1"
Any case will do, not just intent to android market.
Most of the time the app will be installed via Barcode scanner with a binded http schema. So a browser workaround is possible too, HTML5 Client Side Storage, (store argument to browser and get it from there the first time my app runs)
Update
A solution would be to create a cookie,or something to the browser and then access it from the application i installed. Is that possible? If so can you provide some information about that? Can browsers share data with applications?
You can publish a link like that
http://market.android.com/details?id=your.package.name&referrer=your_referrer_parameter
After user clicks this link and installs the application your broadcast receiver will receive a broadcast com.android.vending.INSTALL_REFERRER with "your_referrer_parameter" value.
More info:
http://code.google.com/mobile/analytics/docs/android/#android-market-tracking
Get referrer after installing app from Android Market
Get Android Google Analytics referrer tag
AFAIK what you're asking is not possible. The market only delivers the APK files to devices. However depending on what exactly you want to do there are probably many different work arounds.
Here are a couple thoughts:
If you want the market to deliver a custom argument that is unique for every user, then why not have your app connect to a server on the initial run and download that argument? Even if the market could provide the argument it would have to get it from you and you would presumably have to setup a server to provide the market with the argument.
If you simply want the app to know wether or not it is running for the first time you can do that using a SharedPreference. Query if a preference like hasAppRunBefore exists and if it doesn't then you know the app is running for the first time since install. Then set the hasAppRunBefore variable to some value indicating that it has run before. This implementation will allow users to uninstall the app and reinstall it and after each reinstall the app will run for the first time again.
Another option is a combination of the first two. You can have the app connect to your server and provide the server with the device's UUID then the server can check if its seen that UUID before. If it hasn't it provides the argument otherwise it doesn't.
If you truly need each APK to be different for each device you can setup a server that when a download request is received it compiles a new APK and provides a link to download that APK. That will allow you to generate a new and unique APK for each download. This will however require you to distribute the APK yourself as the Android Market doesn't currently provide this functionality.
I would go ahead and have the website that redirects to the market also push a file to the client. the file can be named something like "yourapp.info" and contain the data you need. Once your app starts, it can search the SD card (it should reside in a couple of well known directories, aka /sdcard/Downloads ) and read that file. There are no access restrictions on the sdcard.
Regarding a Cookie in the browser: I'm not sure that you could access the cookie from just any other app - (check this: blog.watchfire.com/files/advisory-android-browser.pdf - it's not possible to access the cookies) so I think that route will be closed.

Categories

Resources