Sync SQLite db from PC to Android?

waveuponwave

New Member
I have a simple SQLite database on my PC containing one table. I want to use the same SQLite database in my Android app. The data changes on the PC version of the database from time to time. How do I go about syncing the data from the SQLite database on the PC to the SQLite database on the Android device using this platform? What are the options using wifi or usb? What I would really like to do is be able to run a query over the network rather than copy the physical db from the PC to the Android device. Can this be done? Thanks!

*Edit
When I say the same SQLite database I mean I have created the db on the Android device and used the ADB to pull a copy of it off onto my PC. Changes to the db will be made on the PC, and I want to then be able to sync the changes on Android device.
 
Last edited:

rbsoft

Active Member
Licensed User
Longtime User
In most of my database desktop applications I use SQLitening. SQLlitening is an OpenSource Client-/Server extension to SQLite written in PowerBasic. It is small, fast, reliable - choose any three. It can be found here: SQLitening Support Forum - Index

I have it running on LANs and also on internet based Windows Servers. Runs for months now without fail.

My dream - if I find enough time for it - would be to write a B4A client for it.

Rolf
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
I had a similar situation very recently, but since I didn't have enough tools to handle sqlite to my PC, I created an Access DB containing the data of sqlite DB and then handled requests between my Android and my PC, by sendind data which my code transforms into acceptable queries. Yet, I don't know if this is a good solution, even if it works for me so far.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I'm not an expert in this area, but I think some more information is required for you to get the answer you want.

When you say 'sync' do you mean one way, i.e. the db is updated on PC and not on the device?

Will the devices that need to get the information be on the same network, or will it need to connect over the internet?

From my limited knowledge of this area, there are a number of ways you could achieve this, FTP, Webserver and PHP, or even possibly email (I think the intents are available now).

Most of them will require some kind of server, what kind and how it's implemented will depend on what access is required (local or internet).

If you can provide as much information as you can, it will give someone who is an expert in this area a chance at outlining a solution for you.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What is the size of the database file?

If the file is not too large then the simplest solution is to copy the whole file.

There are several ways to connect to the desktop computer.
B4AServer is one solution that helps with avoiding firewall issues. It should be pretty easy to implement a solution that pulls the database from the desktop.
 
Upvote 0
Top