I am looking to make a trial version of an app I made. Basically I want to put a time limit on how long the app will function before a window comes up that states that the user must buy the paid version of the app.
Thanks for any tips ahead of time!
When your application is installed for the first time on the device, connect to your server and assign it a unique id for the device.
Every time the application is started, check for the expiration date corresponding to the device and show appropriate message when the trail period gets over.
Or otherwise, disable a few features and release them only when the user buys it.
Don't use SharedPreferences because the user can easily clear the application data and the time would be reset.
Use a server with a database that stores phone id's and dates. Then retrieve the status for the current phone. When the user installs a new rom, the id will change, so that should not be very often.
Related
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.
I have an Android application I am working on in which the client wants a promotional page in which the first 100 people who download the app get a 10% discount on their order. From what I researched I understand that Google Play doesn't have a very user-friendly way to do this, but for my work-around I wanted to have a "not used coupon" and a "used coupon" image that the waitress could see and type in a short verification code to permanently change the coupon on the app to "used."
From what I read I can use the SharedPreferences to make this happen, but what if the person uninstalls the application and then reinstalls it to get a fresh coupon? Is there anyway in Android to prevent this from happening?
There's actually a very simple API for backing up and a specific helper for SharedPreferences. You don't need to have your own server for this.
http://developer.android.com/training/cloudsync/backupapi.html
footnote:
Never use device ID. Use the account ID to identify the user and the ANDROID_ID to identify the device. If you use IMEI, MAC, serial number or anything that stays the same when device ownership changes, you're gonna have a bad time.
This is what I am trying to do:
Put an app into a free beta
Make the user have a time limit on how long they can use it for "Beta Testing" (Time Bomb But this is easy to get around)
After the users beta time is up (Say 30 days) when the user enters the application [Or better yet they get a screen pop up when they start their phone]a screen pops up saying a message about beta being over, if you like our product please purchase the paid version.
So what I am doing is making a 30 day trial period on my application.
(I'm almost sure this has been done before, I'm wondering how to do it myself)
Probably the easiest way to detect the end of the trial would be store the current date using Preferences when the app first launches, and then compare that stored date with the current date (from the phone or from the internet) on every subsequent launch.
The user could just clear the application's data from Settings, or uninstall and reinstall the app, however, and it would start working again.
One solution to that is to have the app register the device, or the user's google account, with a server of yours on first launch, which the app connects to, to request permission on each subsequent launch.
A cheaper solution would be to design your app so that clearing its data or uninstalling and reinstalling it is enough of a chore to discourage users from doing it; for example, prevent exporting data from the app within the trial, so that the user has to choose between either paying or uninstalling the app and losing all their work.
I am making an app.Which has a free trial version and a premium version.The free version runs as premium for 7 days and after that it will prompt user to buy premium and exit.To do so I have come up with some ideas such as:
1)Identify the device uniquely and send that unique id and date to a server.And on start up check if this device's app is more than 7 days old if so block it.And when the user uninstalls the app and installs again upon registering to the server the app will be blocked.I have read about some ways of identifying a device uniquely.But as this link suggests none of them is reliable and won't work on every device and OS version.
2)I can write a file to sdcard indicating the app installation and check for that particular file on first run to detect re-installation.But that file can be easily deleted by the user and the app re-installed thus obtaining another trial for 7 days which is not acceptable.
Is there a way I can attain my goal?
These things can be done but, I encourage you to think again. What you're proposing is not good for your users and not good for users usually means lower app sales.
The app has to check with your server every time it starts. So I can't use it if I have no data connection or your server is down? Even if I paid for it?
Whatever you do, it can be defeated, especially if using date bound stuff.
I recommend that you think about adding value to the premium version, which is not in the free version, that will encourage people to buy. Or support the free one with advertising, which a lot of people will gladly pay a reasonable amount to get rid of. I recommend NOT releasing a free version which is in someway crippled but rather to make your paid version valuable to the user.
My suggestion is that -
Trial version -
Send a time stamp key(a key as hex string which holds current time and device serial number and trial or premium id) to the server when it is started. In server if any key is not stored, that means the app is started first time and save it for future checking. Server will send a time stamp key(key with server current time) to the device. And device will save this key in local database.
Next time when the app wii start again, the key will be sent to server and server will extract time and serial number from key and check with the first key(as identified first launch), if it exceeds 7 days as identified that the app has been expired.
If network is not available don't start the app.
Premium version -
Extract the trial or premium id from key, it is premium don't expire the app just keep continue the app.
It will work for all cases if user change the device time won't hamper this logic.
There are several packages in my application that user can select each one according to different prices. In server side I store some information of client such as device Id, Android Id and etc.
Based on the package that user choose, for example user has chosen 2 hours plan, server sends me Expire time and I store it in local database.
The question is what is the best way to check that is trial period expired? If user buy 2 hour plan at 12:00, therefore expire time will be at 14:00. I store 14:00 in database and each time application lunched, I check the data base. But the issue is if we assuming that user is using the application how to close application or prompt user that the plan has expired? How do I understand if time of handset is changed by user?
Is use of services best way? what things do you suggest?
==============
Update:
The point that I forgot to say is, because of some restrictions in our office I have access just to three activities that I'm designing and I can't ask other developers who are working on this project, check this and check that or use this variable. But because I'm working on main activity, this activity is the only activity that has access to database.
You should maintain a flag in the SharedPreference and if the flag is set you could show an expiry message instead of your normal activity. You could update the flag using AlarmManager once your period has expired.
Here are few tutorials on AlarmManager and SharedPreferences.
The easiest and best way to do this is the implement BackupSharedPreferences.
The preferences are preserved, even if the app is uninstalled and reinstalled.
Simply save the install date as a preference and you are good to go.
Here's the theory: http://developer.android.com/reference/android/app/backup/SharedPreferencesBackupHelper.html
Here's the example:
Android SharedPreferences Backup Not Working
:) Pete