Search code examples
androidvisual-studiosqlitecordovagenymotion

Use a common database for Sqlite


I am currently using Apache Cordova with Visual Studio 2015 for my mobile app development. I am also using Genymotion emulator and a Sqlite Database.

I noticed, if I am to use two different devices(Merchant POV & Consumer POV) to demonstrate my app, the database I will be using will be not be a synced database due to it being two different devices.

Is there any way I can make sure that both devices are using a synced database?


Solution

  • You would need a custom sync API to synchronize data like that. But if you are only in the early stage of testing your local database, you can make a script that loads some sample data wich will be executed on opening of your app. That way any device will run the same script and then have the same sample data.

    But if you want to insert data on a device and then have that same data on another, you will have to sync it with your API.

    hope it helps