- Home /
How to access a database upon android app uninstall [C#]
Hello,
I'm using a leaderboard service (data stored externally) for my android app. I have a working method that clears data upon profile reset from within the app. However, when I uninstall the app from my device, the data (understandably but undesirably) remains on the database.
Is there a way to clear player data in the database (call method mentioned above?) during the app's un-installation process?
Answer by Socapex · Mar 15, 2017 at 05:17 AM
I think you want to keep the data, in case the user re-installs the app. Potentially have a cleanup script run on accounts with 1-3 years inactivity.
Right, a cleanup script on the database is the usual way. You just need an extra "lastSeen" field that is tied to an account. Whenever there is "activity" you would set it to the current date / time.
So the cleanup script can simply filder out all accounts which had no activity for a certain time. Bigger companies might have a two step system. After a certain time the account data is "exported" / compressed / archived into a seperate database where it remains for a way longer period until it's finally deleted. This allows easy reactivation in case the user comes back after a year or two. At the same time it keeps the working database small. Depending on the type of game the hibernate state might be triggered after a week or a month while the final deletion can be somesthing like 5 years.
I know some games (browser games where you have to create an account with email address) that simply send out a warning email that the account has been inactive for XX days and will be deleted in YY days.
Thank you @Socapex (love the Gir icon BTW, huge Zim fan:) and @Bunny83 for the feedback!
What you propose sounds like a very robust solution. However, what I have in $$anonymous$$d (accompanying my current skills as a programmer) is much, much-much simpler. The existing setup is very basic; no emails involved, just a search for name availability. $$anonymous$$y primary concern is users intentionally cluttering the leaderboard with profile entries. $$anonymous$$y solution? If you uninstall the app you loose your place on the breadboard; that's what I'm going for at least.
I'm trying to figure out how to access/modify the Un-installation process of my android app; ideally with Unity/$$anonymous$$onodevelop/C#.
[edit:] Hmm.. Uninstalling and then "pushing a build" on my device from from the Unity Editor did something weird with the profile name. I wonder if said editor build is the same as an installation. Probably not.. I need to look into this some more.