Jimmy Kim
Jimmy Kim

Reputation: 103

Android SQLite Databases (Explain Like I'm Five)

I'm trying to use SQLite Databases, but as I'm learning (via the internet), I'm getting really confused and I have a few questions.

  1. Where is the data actually stored? For example, let's say I want a database that stores all the usernames and all the passwords for everyone who uses my application. I need to write this information onto the database, but where is it? Is it on the user's phone? Is it on the web somewhere? Whenever the user goes onto the app, I need to read from the database. Does it read from somewhere online or does it only read from the database created on the user's phone? Is there any way to create a static database that all users are able to write to?
  2. If I'm using a SQLite Database to store username and passwords, do I need to secure it with a password? If so, how? I've read on some websites that this information can easily be read if it isn't secured with a password, but others tell me that it can only be accessed by my application.

Upvotes: 0

Views: 71

Answers (2)

user4715375
user4715375

Reputation:

1)straight answer is: When u use SqLite database in android application, in the sense your application have sqliteDatabase, means when u download that application in to your device then all sqlite database data stored in device.

2) For password security u have to encrypt password and store in sqlite database.

Upvotes: 1

Logic
Logic

Reputation: 2258

SQLite Databases are used where you need to store the data of particular user or save his usage or some data which is permanent. This DataBase resides in the Android device. If you want to save the user accounts (say username & password) this should be done in the server (backend) and should get the data by using service calls every time.

Ex: You have a comic book application for which the user has to signup / signin. Then you maintain the user account in the server. After signup / signin, when user downloads a book to read. Make that book stored in the SQLite Database in Android device, so that it will be available forever.

If you try to maintain user accounts in the SQLite DataBase, you cannot get data of all the users an store in one Android device. So global data should be on server and Local data should be stores in SQLite DataBase.

Upvotes: 4

Related Questions