Nitrodbz
Nitrodbz

Reputation: 1286

Android: SQLite Database in android for multiple users

I've read that the best database to use is SQLite in android. I haven't done a lot of android development.

My goal is to create an app that has a database in which multiple users can access to. If user 1 and user 2 post content, they both store the content in a database which both users have access to that information. Can someone explain how this could be achieved or provide an example. I've searched SQLite but I'm afraid these are only local database (am I correct in saying this)?

Upvotes: 0

Views: 5222

Answers (4)

blackpanther
blackpanther

Reputation: 11486

The best and most easiest option is to use LAMP. PHP can be used to access a MySQL database and you can use Web Services, like SOAP or even JSON, to consume the data contained in the database or interact with the MySQL instance. The advantage of using Web Services like this is that it is relatively simple to implement and use in comparison to using a Web Browser App in the Android App itself. Remember, the SQLite database within each user's Android device can be used to temporarily store data until it is ready to be uploaded to the remote MySQL database and in this way an SQLite database could still be quite useful in any Android/Mobile Application.

A tutorial is shown at this site: http://www.helloandroid.com/tutorials/connecting-mysql-database

Upvotes: 0

Koso
Koso

Reputation: 3199

Yes you are correct. Sqlite database is used just as local database. In this case you need web database. Like benilMathew said, you can use MySQL but you should definitely check this:

https://parse.com

No need to make server side code (in php etc.), easy to use API for Android (also for iOS, WinMobile...) and everything is well documented. I am using it and it satisfies all my requirements.

Upvotes: 0

tony m
tony m

Reputation: 4779

Android sqlite db is a local database residing in the phone's memory. If you want to have a commonly synched DB for your users who are using your app from different phones, then you need to ideally have a cloud based database which is accessible to any authorised users of your app. You can consider using google app engine for hosting a cloud database and google cloud endpoints for accessing the data through apis.

Upvotes: 1

Benil Mathew
Benil Mathew

Reputation: 1634

If you want to have a database of that sort its is recommended to use MySQL database or something similar.Using some APIs you can connect to it.

There are lot of examples with MySQL and Php which you can make use of which i think would be the best in your case rather than SQLite .

Upvotes: 3

Related Questions