Sahar Sahar - 1 year ago 115
Android Question

Sync android map with a SQLite database on a server

I created an SQLite database for my android map application that keeps user's favorite markers using this tutorial,

now I want to create another same database that allows users to share some markers with others who uses this app, so I need to upload my database on a server and sync it with my app and restore shared markers.

which server can I use that keeps my database in SQL not in JSON.
how can I sync my app with my uploaded database?

Answer Source

I would not recommend to talk directly to your remote database, because you have to store the authentication credentials inside the app and its pretty easy to reverse engineer your app and get this credentials.

I would recommend you to write a small service/API with 2 endpoints. One endpoint to get all the markers available and the other one to store the markers.

The communication with your API you can handle with e.g. Retrofit. You store the markers via your POST call. With the GET call you get all the markers available in the database. Then you can store the response got from the call inside the users local database.


REST API with NodeJS and MongoDB

Retrofit Tutorial

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download