Search code examples
androidsqlitestoragemulti-user

Share access to local DB between multiple users on one Android device


Android can support multiple users on one device.

Is it possible to write an Android app allowing multiple users on one device to read and write data from a shared local database (e.g. SQLite)?

So if user1 writes something to the DB, user2 can view that, and also overwrite it.


Solution

  • Two options:

    1. Use two apps. One app exports access to the DB as a public service. The second app, the one users interact with, calls that service.
    2. Put the DB in a public folder. This may be unsafe.

    (Based on comments from @FunkSoulBrother, @Ewald, and @k3b, with thanks.)