Sandra123
Sandra123

Reputation: 39

How to store local SQLite database on a server

I have created an android application with an SQLite database. However, I did not realize this was stored locally. Is there any way to connect the locally distributed SQLite database on personal devices to a global DB Server?

I need the database to be synchronized across all devices.

Upvotes: 1

Views: 2016

Answers (1)

greenhoorn
greenhoorn

Reputation: 1561

Depending on your requirements, there are several ways to achieve this.

Basically what you'll want is an API, which exposes the basic CRUD operations on your database. Your devices then interact with the API and store the data directly on the server.

The next step would be allowing the devices to save the data offline and sync it as soon as the device gets online. In this scenario, you'll need a local sqlite (or whatever) database in order to keep track of what changed on the device.

I would recommend you to read some stuff out there about synchronizing databases on mobile devices. Offline as well as online. You can find a basic explanation in this thread.

Upvotes: 1

Related Questions