Michael Capobianco
Michael Capobianco

Reputation: 812

SQLite, MySQL or Both for Android Application

I'm in the process of designing an Android application right now.

I understand SQLite works on the phone device within the file structure. However I'm not sure if it's practical for our use.

If I'm wanting to store data that's available to all users (i.e. if someone updates their profile, it can be seen by all other users), can that be done using SQLite somehow? Or must we use a client-server model such as MySQL?

Is it practical to store user-specific information using SQLite and public information using MySQL?

Thank you

Upvotes: 1

Views: 3137

Answers (5)

vishnu pratap singh
vishnu pratap singh

Reputation: 159

yeah i think the model you are proposing should have no problem. Even i'm using a model something similar to what you are saying. I store some information on local sqlite db and majority of information in mysql db. For sending data from android device to mysql db you will have to write a mysql scipt on a page and android device will hit that page with the help of http request. You can send your data in that http request

Upvotes: 0

Julian
Julian

Reputation: 27

Is it practical to store user-specific information using SQL Lite and public information using MySQL?

Yes, This is exactly what I'm doing with my app. It's a very common practice. I am storing information in a MySql db stored on a server that all users can read from. They can pull specific information to the device. From there I have a class in the app that stores information that they've selected within a SQLite db. You'll easily be able to add information to the MySql db on the server that all users can view.

Upvotes: 1

Aromal Sasidharan
Aromal Sasidharan

Reputation: 678

you mean all users going to use a single phone, probably not, the reason for recommending sqlite database for android is that its the lightweight, non memory eater and thus best suitable to mobile phones. Sqlite database can be used in phone while at server side we can use any. The only thing is use a method like sending xml request to server from phone, where server will send respond as xml or json, while the phone parse the xml and use the data in it. this is how online apps works in mobile phones..... ya ofcourse use mysql at server side and do the communication using as request - response yes the client-server.

Upvotes: 1

AlfredoVR
AlfredoVR

Reputation: 4287

What you want to do is a Client-Server Architecture, store the data in your central server and get a copy of the working data on the phone. MySQL and SQLite don't share everything but it's close. Read the documentation on SQLite and you will see. SQLite can't serve files like MySQL if that's your question via the network. You'll have to write that on your own. I suggest making a webservice.

Upvotes: 3

aF.
aF.

Reputation: 66687

If you want info to be available to all users you need a client-server model such as MySQL.

If you use SQL Lite, the only possible way to update that info without requesting it from a server is to make an Update on the application (not doable).


Don't forget that you'll require internet ON for these types of applications.

Upvotes: 1

Related Questions