Search code examples
androidmysqlandroid-studioandroid-sqlite

Synchronize offline SQLite database with online MySQL database


I'm creating a Android application that store the data in online backend MySQL and store it in app sqllite. Which means when user is online, data sync with online backend database to sqlite database. When user offline, so he/she can use the sqlite data.is this proper way? Or what I can do to better solution ?


Solution

  • You should be using Sync Adapters.

    Checkout how it works in the following link and go further on the documentation for more info.

    https://developer.android.com/training/sync-adapters/index.html