• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by donimation · Mar 13, 2017 at 06:32 PM · accessappdatabase handlinguninstallexternal files

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Mar 15, 2017 at 06:43 AM 0
Share

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.

avatar image donimation · Mar 16, 2017 at 11:50 PM 0
Share

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 mind (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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

65 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saved Android app files get automatically recovered from nowhere even after re-installing app. 3 Answers

Screen Saver Development in Unity? 3 Answers

bad quality icon on iOS 1 Answer

Resize GUI Button (linked to website) ?? 1 Answer

Wp8 an Android 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges