Reputation: 2190
I'm creating an app which allows a user to login and retrieve some information about his account from a server. These information are inserted in a SQLite database, and then the user can set other preferences on them (I use sharedpreferences for this).
Now i want to expand the app allowing more users to login. The problem is that i don't know exactly how to manage the database with multiple users, infact:
How can I solve this problem? Thanks..
Upvotes: 2
Views: 2329
Reputation: 543
This can be done in multiple ways 1. Have user id table created and link that to other tables using foreign key. another way is 2. create new DB for each of the users. so your database name will have username. If user name changes then database changes.
with second way your code changes will be minimal.
Upvotes: 1