Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

After uninstall, how can i preserve my app's data in scoped storage?

I have updated my app to comply with the newly enforced SAF for accessing app files. I have moved all my app's data files to its proper app directory.
/sdcard/Android/data/[APP_PACKAGE_NAME]/files

The problem is Visual Studio/Xamarin wants to uninstall the app before installing when i try to debug. The uninstall process triggers android to delete all my app's data. This is becoming extremely tedious to restore the app data every time i want to run debug.

Is there anyway to prevent this file deletion when i debug?

Best Answer

  • Sk1llSh0tSk1llSh0t Member
    Accepted Answer

    Nevermind. i found the setting under preferences to preserve app data.

Answers

  • Sk1llSh0tSk1llSh0t Member
    Accepted Answer

    Nevermind. i found the setting under preferences to preserve app data.

  • SeekerSeeker Member ✭✭

    it will be nice if you share the detail/solution here as well.

  • Sk1llSh0tSk1llSh0t Member

    In VS 2019 for Mac, it is found under Preferences -> Projects -> Android -> Check "Preserve data/cache between application deploys". This is how I solved the issue.

Sign In or Register to comment.