Search code examples
androiddatabasesqliteandroid-contentprovidersharing

How Can I Share a Database Between Apps that Persists After App Removal?


Is it possible to have a local shared SQLite database between different android apps where if the user removes any of the apps (including the first installed app) it won't delete the shared database?

I know that Content Providers are usually the way to go with sharing data between apps but my understanding is that a content provider and database will get uninstalled when the original installed program is uninstalled. Is this correct?

I realize that storing the data online solves the shared database problem but it also brings along problems like app slowness, connection issues, if the app grows large then large server fees, etc.

Is there a good solution here?


Solution

  • Is it possible to have a local shared SQLite database between different android apps where if the user removes any of the apps (including the first installed app) it won't delete the shared database?

    You would have to put it on external storage. From a privacy and security standpoint, this is horrible. Plus, the user can delete it.

    I know that Content Providers are usually the way to go with sharing data between apps but my understanding is that a content provider and database will get uninstalled when the original installed program is uninstalled. Is this correct?

    Yes.

    Is there a good solution here?

    Have one app, rather than several apps.