When you uninstall a Windows program, the installer usually asks whether to delete your preferences and data. If you choose not to, all your program data will be intact if you re-install the program again. For instance if choose to keep data while uninstalling a game, you will get back your saved games and preferences upon re-installing.

On the contrary, you lose all your data and preferences when you re-install android apps. In fact you will never be asked whether to keep data for later use while uninstalling any android app - all data is just lost.

why android app uninstall removes data

Why Android App Data Is Lost on Uninstalling.

Most operating systems provide specific locations where programs can store their data. For instance in Windows 7, you would find a directory named "C:\Program Data". Similarly android provides 3 places where an app can store data-

  1. Internal storage memory.
  2. External storage memory (Usually SD card).
  3. App database (sqlite database).

Although an app can use internal or external memory to store data, the recommended secure way is to use the app database. Android creates an app database for every app the first time it is installed. Also an app's database can only be accessed by that app. This ensures that a rogue app can't steal away data from another app. This database is what 99.9% apps use to store their data. The location of all data for any app would be-

/data/data/<app_package_name>

As part of security, android keeps this database only while the app is installed and available. As soon as you hit the uninstall button, android wipes out the app database along with the app. And if you re-install the app, android will create a fresh new database for the app again. That's the reason why app data is lost and can never be retrieved once you uninstall an app.

Why Apps Don't Use Internal/External Storage for App Data?

Even though restoring data on re-install is a nice to have feature for any app, most developers still go with the non-restorable app database because-

  1. App database is secure while internal/external storage is insecure and can be accessed by any other app.
  2. If app data is stored in external storage, the app could dis-function if the SD card is removed, replaced or damaged.
  3. Developers are lazy. Android provides a simple and easy interface to read, write and maintain the app database. Using the internal/external storage means more work and re-inventing a lot of stuff that android is already giving in a platter.

Still there are apps which store data in internal/external storage due to explicit needs. For instance the "Sec Notes" app which is a secure notes/spreadsheets/checklists app stores the data backup to external storage as an encrypted file. This is to allow users to regain their notes if they change phone or want to access the notes in another android device. But most apps doesn't have such compelling reasons to implement data backups for re-installs.

Also read: How to properly re-install android apps.