Unity Android: Keep save after deleting app? - android

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

Related

Google Inapp purchasing and trial period

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.

upgrade trial to full version

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?

Find out why an Android app is being uninstalled

My app is having success in Google Play with several million downloads. However, almost 50% of users have uninstalled it already.
I don't think that's a critical number but I'd like to find out why users uninstalls it, so I'd like to ask it to users using a simple form, only to the ones who want to answer of course.
Now problem is when to show that optional form. I've seen I can't use ACTION_PACKAGE_REMOVED because app that's being uninstalled won't receive that broadcast.
Of course I don't want to ever forbid the user to uninstall my app, but I do want to know when to start my optional form. Can you think of any idea how to do this?
Also, I've seen that Google Play asks the user why he's uninstalling any app and gives a few options (missing space, don't need it, ...). Is there any way to get those responses from Google, regarding my app?
If you can give me any other ideas how to investigate main reasons why users uninstall my app, to improve it, I'd be really thankful.
Once the user uninstalls the app, there's nothing you can do. 50% retention rate isn't actually that bad..
I would propose you look at how the users are using the app, whether it's crashing and how often it's being used: these can then lead as indicators to make an educated guess why they might be uninstalling your app.
Crashes:
These aren't always reported - it's only if the user elects to report it you'll see it in Google Play. Try Crashlytics for a more detailed analysis of how/when/why your app crashes.
Analytics:
I use Flurry to log events and work out what my users are doing. You could also look in to some A/B testing.

How to implement trialware model on Android?

Any tips on how to implement a trialware model for Android apps? I plan to release my app as a free app that expires after 30 days unless the user buys the license via an in-app purchase.
I can use the Android Market API to tell if they bought the license, so my main question is how to prevent the user from un-installing and re-installing my app every 30 days? Can I save something to their phone in a permanent and reliable way that will remain on the phone even if they uninstall? I know nothing will stop a determined hacker, I just want to stop the average user.
I am also open to different approaches to going trialware on Android.
Thanks in advance,
Barry
Have you read the documentation on Application Licensing? Specifically, have a look at Implementing a Policy
I also have found this resource very helpful in determining the best way to get a unique ID for any one device. Android - Identifying App Installations -- They discuss pros/cons to the different approaches -- Straight from the developer's mouths!
I would avoid leaving unwanted remains of the application on their phone.
Instead, you can take some unique identifier of the device, and send it to your server, if this ID was not registered before, send it activation code, if it was, don't send it.
Store this activation code in some shared preferences etc. and when the application starts, check if the activation code is there and if it is valid.
They don't even have to uninstall, just clean app data. You can save something to an obscure location on the SD card, but that's also fairly easy to circumvent, even easier if they read this forum :) Your best bet is to have the app call home to your server and check if licensed periodically. That of course comes with it's own problems: do you allow it to run if network connection is never available, etc.

Android: saving info for trial application

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.

Categories

Resources