Issue
(I'm new to android development)
Say android app-1 created a database hello
, via roo
.
Then could android app-2 created a database hello
, on the same phone?
My guess is yes, since room use sqlite, each app may start a new sqlite instance, and may store its data in private space, otherwise it's too easy to get conflict. But I'm not sure.
The questions are:
- Will 2 app share the same sqlite instance, or each app will start a new sqlite?
- Is the database's name app scoped?
- I guess the data of a database is also private to the application?
(I've searched about this, didn't get a confirm.)
Solution
By default, Room databases are stored in internal storage, and each app has its own internal storage. You can have two databases named hello
, one per app, without a problem.
Answered By - CommonsWare
Answer Checked By - Mildred Charles (JavaFixing Admin)