I want to publish a trial of my app. In this app, the user has to save a lot of values in the sharedPreferences. If he decides to buy the full version, would the trial be deinstalled, and the sheredPreferences would be deleted too? Does anyone know that?
It would be very nice, if the sharedPreferences wouldnt be deleted, so the full version has access to the value of the trial, therefor the user hasnt to save all the values again.
Yes, the SharedPreferences are deleted when they uninstall the trial and install the full.
I see a few options you could use, either use the same app for both and use an unlock style of purchase, either via in app purchase, or by selling a separate "unlock" app.
You could save their settings to a remote server and have the full app download them from there. This one has the advantage of allowing syncing of settings across multiple devices, downside is you'd have to make and maintain a server.
You could save them to some other permanent file on the device, but personally I hate it when an app leaves something behind when I uninstall it.
Is it possible, to publish the trial with a lower versioncode as the full version, so the trial only would be updated and the sharedPreferences wouldnt be deleted?
Related
I have created an app where you can unlock certain things and also you can buy them with real money. Because of this it would be a shame if a user loses all his unlocked things when removing the app.
At first I used PlayerPrefs, but that isn't safe for these kind of things I learned. Also PlayerPrefs get cleared when removing the app.
Then I found out how to serialize my data and save it to the "PersistentDataPath". This will be much safer, but it also gets cleared when removing the app.
Is there a way, besides working with a external server, in which I can store my players unlocked things and it won't get deleted when they remove the app? I also read something about the permission WRITE_EXTERNAL_STORAGE not allowing this.
I just want to avoid raging players who delete the app and reinstall it later and then figuring out everything they paid for is gone.
Thanks in advance lads!
You could use Google Play Games they have a "Saved Games" feature. That way the savegame will even survive when the user gets a new phone.
https://developers.google.com/games/services/common/concepts/savedgames
I have a paid app in the Google Play Store. I'm considering reducing the price of that app (somewhat; not all the way to free) and offering one of the features as a separate in-app purchase.
If I did that, I wouldn't want to yank the feature away from anybody who's already bought it.
Is there any way to figure out either the date that the user bought my app, or the original version of the app that they bought, or something like that? I'd like to say something like, "If the app was before the price change (either by date or by version), they should have the feature for free; otherwise, require IAP to unlock the feature."
For example, iOS does have a feature like this; the app receipt includes an "originalVersion" field which can be used to control access to features.
Unfortunately for your customers, this is impossible. There is no API call or anything else to Google Play where you can get the time on which the app was bought.
I know there is an android-publisher API in existance, however it doesn't offer any feature to check that.
The functions you want to use are not public availible and only used by the Playstore internally!
Workarounds which you could do:
1. Get the time the app was installed
On the first start you could check that and unlock the features.
Warning: This system could be abused by changing the time on the device
long installed = context
.getPackageManager()
.getPackageInfo(context.getPackageName(), 0)
.firstInstallTime;
2. Give users free keys
You could give every user who's using the app atm a free key via mail or push notification
3. Unlock the inapp purchase now
Publish an app update which unlocks the inapp purchase for free. After a few weeks you could pusblish your new version with the lower price and just unlock the features as if your current customers had bought your extension.
You might be able to hack your way around this if you're using some sort of persistent storage.
For SharedPreferences, on the first run, do a check for one of your preferences using SharedPreferences.contains(). If it contains it, the app must have already been installed. If not, set another preference that marks the user as new, and set yet one more so it doesn't do the check every time.
That might only work if the preference doesn't have a "default" value, I'm not entirely sure if setting a default in xml will mark it as contained.
You could do something similar if you have any assets that get transferred to SD, or any similar one-time setup. Just check to see if it's already done before doing it the first time.
If you're using an SQLite DB, you could increment the DB version and mark as "paid" in onUpgrade() if coming from the current version(or earlier).
There are some pitfalls here, though. For instance, if a previous paid customer completely uninstalls before installing the new version, or if it's on a new device. For that reason you should:
4. Provide Support
In the about or FAQ section of your app and on first run of your new version set a support mail adress which customers can use if they have any problems because the new features were not unlocked for them.
They could provide any proof (bill) for their purchase.
Like I said, those ideas are workarounds, but I don't know of any "official" way to check to see an app install is an upgrade or an initial install.
Your best option may be a combination of those four.
FYI: I've opened a feature request/idea in Google Cloud Connect for work which you could vote: https://connect.googleforwork.com/ideas/9392 (You can only vote if you have a paid Google Buisiness Account)
I hope this helps you at least a bit.
As far as i know, the best you can do is find the date it was installed. http://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime
My app has been pirated recently and I'm trying to prevent further losses in revenue.
I am using an In App Purchase system to purchase the premium version of the app.
Apparently someone bought my app and released a pirated version by doing a backup (where premium= true)
Now i would like to run an IAP check when my app is installed to check if the user really has purchased the premium version.
Is there a way to do this as soon as my app is installed or updated?
UPDATE:
I have to run the IAP without using SharedPreferences as they can easily be backed up and the backup distributed
Why not just check it once a day (or week)? You can set the SharedPreference to the last time a successful check was completed. Of course, you'll want to check for future dates and reject those, since that's what I'd do to get around a system like that. You might want to give a 24-hour leeway on future dates to accommodate for time-zone changing, but it shouldn't be too hard.
This way, even if someone backed up your app, it would only work for the next day or so before checking again.
To be honest, though, this might not help much. If people are pirating your app, they'll find ways to get around (just about) anything you throw at them.
I am building an application which I wish to upload to the app store as a paid app. But i would like to post it as a trial app for a set amount of time. I looked at all the options in the app billing version 3. I have found a few problems.
If I create my app with a non-consumable inapp item then i will not be able to keep it for a set duration as a trial app(Please let me know if my assumption is correct).
I f I create it via a subscription based model then is there a way I can make the subscriptions last forever and not yearly?
I think I know what you're asking, but if I'm wrong let me know.
What you want to do is let the user download the app for free, let them use it for say 7 days, then require them to pay for the upgrade IAP (in app purchase) or prevent them using it?
If the above is correct there is one main problem that you're going to encounter. To track the date the user started using the app you will have to use something like a shared preference, an entry in a sql db or some local file etc... The only problem with all of these options is the user can erase the data and install the app again to use it free for another 7 days. The only way around this is to implement your own web registration service which I imagine would be a little too difficult.
The best way, assuming you're not too bothered about the people who will bypass it, is to capture the date/time when the app first starts and save it. Each time the app starts check if they have purchased the upgrade, if not check the current date/time against the stored value and if your trial period has elapsed, prompt them to buy the upgrade or close the app.
The main problem here is the user uninstalling / reinstalling the app and losing the shared preferences.
The easy way around this is to use Google's SharedPreferencesBackupHelper
Android SharedPreferences Backup Not Working
You simply save the install date as a preference. Even if the app is un-installed, if they install it again, the orig install date will still be available for you to query.
I want to save some info regarding a trial version an application.
I want this info to be persistent in order to detect if the user removed the application and installed it again after the trial expiry.
what is the best place to store such info
thanks
Most of the times the solution to this problem is to keep an server side check,
But if you dont want to involve a server its better to give some limited functionality in your trail app and full in the paid version.
There are other methods too like Time Trial but again they all depends on persistent data so they also fails if the user uninstalls and installs again your applucation
Store it in external file.
it wont be deleted after user uninstalled the app.
but
Serverside check by Device ID is the good way ..
I'm working on the same "problem" at the moment (offline solution for trial time expired apps):
My findings: There is no way to ensure that a user never can reinstall & reuse a (time) trial app but there is a way to 'nearly' prevent it:
Use shared preferences / a database / file saved on internal storage containing the install timestamp.
If the device has an external storage card (most devices have) also save the timestamp on the sd card.
The only possiblity to use your application also after expiring is if the user 1. clears app data on the phone and 2. finds the timestamp file on the sd card and also kills this one.
If he "just kills" the first or second check the killed one can be restored on next app start.