Retain app data after uninstall (2024)

Retain app data after uninstall (2)

Generally, as soon as the user uninstalls an application, application data is removed from the Android operating system.
This data includes the app data stored in the internal storage of the device, typically /data/data/{package_name} and the application-specific directory on the external storage. Refer to the official documentation to learn more about storing data on Android.

In Android 10, a new Manifest flag called hasFragileUserData is added. Adding this flag to the manifest file gives end-users and option to retain application data even after the application is uninstalled.

This flag should be added inside the application tag of the Manifest file.

Before adding this flag to your Manifest file make sure you have bumped up the compileSdkVersion and targetSdkVersion to API level 29

When uninstalling the application users will see a checkbox in which they can check and retain the application data on the device even after the application is uninstalled.

Retain app data after uninstall (3)

Data stored in the internal storage i.e. /data/data/{package_name} and the data stored on the Application-specific storage on the external storage will not be removed from the device.

Retain app data after uninstall (2024)
Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 6123

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.