Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 $$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.

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.

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

Can't access Instantiated UI element 2 Answers

Access Unity 5 standard assets scripts(javascript). 1 Answer

MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object . 0 Answers

Read boolean from parent's script 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges