Lot of complexities are involved in this. I am also looking for a simple solution.
There isn't one. Using a full RDBMS then one popular way of syncing data is to use hashing. SQL Server has CHECKSUM, BINARY_CHECKSUM and HASHBYTES; MySQL has MD5 checksum. So each row in a table has a unique(ish) checksum column. So you can now compare checksum columns between two tables to identify differences.
Say you have 1 million records in your table. You would still need need to transfer 15mb of data to the server if you were storing an MD5 hash in a column (128 bytes per row). So as well a having a hash per row you use an aggregate hash function as well. So to sync from the app:
1. Generate an MD5 hash for groups of 10000 rows in your table.
2. Send your 128k of hash data to the server.
3. Server generates it's hashes for it's rows in groups of 10000.
4. Server compares it's hashes with hashes from the app.
5. Server sends response to App telling it which hashes are different.
Lets assume you only have one group which has a different hash.
5. Generate another hash for each group of 1000 rows in the ten thousand grouping.
6. Send result to the server.
7. Server generate it's hashes for it's groups of 1000 rows.
8. Server sends response to App telling it which hashes are different.
Again assume you only have one group which has a different hash
6. Generate another hash for each group of 100 rows in the one thousand grouping.
7. Send result to the server.
8. Server generate it's hashes for it's groups of 100 rows.
9. Server sends response to App telling it which hashes are different.
Again assume you only have one group which has a different hash
8. Generate another hash for each group of 10 rows in the one hundred grouping.
9. Send result to the server.
10. Server generate it's hashes for it's groups of 10 rows.
11. Server sends response to App telling it which hashes are different.
Again assume you only have one group which has a different hash
12. Send the checksum column for each of the 10 rows to the server.
13. Server compares the 10 hashes from the app with it's 10 checksum columns.
14. Server sends response to App telling it which rows are different.
15. App sends row which are different to server.
This is a very simplified version compared to what you might actually implement but hopefully explains the approach. In an actual implementation you may chose to use a weighted grouping of the rows. For example on the basis that older rows are less likely to be changed than newer rows.
One of the big issues is that SQLite has no hash functions built in. However
Spatialite does have a MD5 and a MD5 aggregate function but unfortunately the version wrapped for B4A doesn't. If I was looking at doing a project like this using SQLite and the hashing approach I would be asking
@warwound very nicely if he could possibly update his library to wrap version 4.03