I developed an android App which uses a local Sqlite Db on the Devices. Now I want to sync the database with the database on a second device. The devices are never connect to the internet. Is there an "easy" way to synchronize the db via bluetooth or nfc? So far I've only heard about the online synchronization with MySQL?
Thanks
Related
I have an Android app that needs to retrieve info from a server that isn't related to the app.
I'll try to be more clear:
There's a server that is being updated every once in a while, and I need the devices to retrieve data from that server. How can I achieve this?
I thought about SQLite but I don't seem to understand how it will connect to an external database that isn't on the device
I am using Firestore as a NoSQL databse in my Android app. I want to store data locally in my Android device and avoid syncing with Firestore server in the initial stages of app. Is is possible for the data to persist on device even if app or mobile device restarts without syncing with Firestore database? If yes then how do I do it ?
I want to store data locally in my android device and avoid syncing with Firestore server in the initial stages of app.
According to the official documentation regarding Firestore offline persistens:
For Android and iOS, offline persistence is enabled by default. To disable persistence, set the PersistenceEnabled option to false.
And to answer the second question:
Is is possible for the data to persist on device even if app or mobile device restarts without syncing with Firestore database?
Yes it is. This kind of persistens is called disk persistence, which means that recently listened data (as well as any pending writes from the app to the database) are persisted to disk. The data in this cache survives app restarts, and phone reboots.
I use the Parse.com Cloud service in my Android app to sync data between devices.
I use the app mainly offline and use the local DB
Parse.enableLocalDatastore(getApplicationContext());
I would like to use PinInBackground() to store the data locally and sync once every day by hitting the sync button in my app.
Now if my app crashes or the device restarts - how do I know which objects are stored only locally so I can sync them with Save()?
pinInBackground() will not save to the cloud eventually. The only action that does BOTH is saveEventually(), which will pin your objects locally if your network is down so that you can still query them even though you are still offline.
More in the Parse Android guide
I'm new to android sync so I really need ideas to get started. Actually my app's requirement is like this: My app needs to connect to my database online. But my android app can be used offline meaning, the user can add records to a local db, say sqlite. And then when the user connects to the Internet, the app should automatically connect to the server and add the record the user added when he is not online. Can you give me some considerations and ideas on how to do this? I really need your help guys. Thanks.
I will recommend you to go for Sync Adapter. See these links
AbstractThreadedSyncAdapter and Creating Sync Adapter.
I have used them long time ago. I will say that it is the best approach for syncing data between device and server. Usually, email apps use these sync adapters.
Sample is also given there. Download it if you want to go deep inside of "HOW".
Thank You!
You need to run background service like android alarm manager. You need to check that device is connected via internet or not. if device is connected via internet then sync the data to server.
Check this like to the way of data sync
How to sync SQLite database on Android phone with MySQL database on server?
Thanks
I'm creating an Android App that would have to access a database on my PC. I know how to program in Java and access a MySQL on my PC using JDBC ODBC. Could anyone lead me to the right place?
android don't support jdbc.
why don't you make a application-server?
the architecture is this.
Android <<--(using REST/JSON)-->>Application-Server(including JDBC or ODBC) <<-->> Database
using json or rest is good to reduce data traffic.
and generally the application server is faster than Android device.