Android Question Sqllite & Mysql update local tables

ocalle

Active Member
Licensed User
Longtime User
Hi, I need syncro tables to avoid continuos remote connections.

by one way i have a mysql server with tables (Im using JRC2 remote connector)
in the other hand on phone i have the same tables in SQL Lite to allow local operations with common data.
Did someone know a method to get Mysql tables from server to local Sqllite tables?

Thank you in advance.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Alternative solution: [B4X] CloudKVS - synchronized key / value store

You need to download the data and insert it into the local database. If the table data is not too large then you can download the complete table, delete the local table and insert the new table. If the data can be updated both locally and remotely then you need a more sophisticated solution. You can add a "modified time" column and use it for the synchronization. This is implemented in CloudKVS.
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Thank you! @Erel What I did is this:

1st Create in the server the tables in a database, load the basics with heidisql
Then in the mobile application I recreate the same empty tables.

2nd At the beginning of the execution of the app in the day I connect to the Mysql server through the JRCD2 connector with stored procedure commands (which I can change in the server without affecting the mobile application).

The fact of loading everything the first time in the Sqllite boards avoids later heavy loads, the basic boards go only once.

3th Then I use the sqllite tables to fill in data forms.

4 When I make an insert, delete or update I do it in the 2 tables both in the server and in the local table. So that the next day the data remains identical.

I think cloudkvs is fantastic but I still have a hard time mastering it.
Translated with www.DeepL.com/Translator (@Informatix courtesy)
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hey @ocalle, if you could share a small example with this feature I think it would be fantastic!
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Upvote 0
Top