Android Question Can't get CloudKVS to work as I think it should

davelew1s

Active Member
Licensed User
Longtime User
I tried to use cloudkvs in an existing APP but it did not work the way I thought it should so I went back to basics using Erel's https://www.b4x.com/android/forum/threads/b4x-cloudkvs-synchronized-key-value-store.63536/#content
I use the server as is only changed the port number
In the b4a code I changed the url and db.db save location.
I start the server then the APP on 2 devices change the Favourite number on 1 device and it changes o the other... perfect
Changing the Fav No on one device then the other works for a short time then I can only use one device to update the other(if that makes sense)
If I delete all the db's start again it works again for a while usually only 5 to 10 Fav No changes.
I have searched the forum but not found anything that helps.
Any ideas? Tanks Dave.
 

davelew1s

Active Member
Licensed User
Longtime User
Are the clocks on both devices properly set?
Hi Erel thanks for the reply 1 device was 1 hour out I have set both devices and the desktop the same and it seems to be working as expected.
This could be a minor problem neither of my devices could auto set the time and date hence the difference, I assume there is no way of checking from the server.
Thanks again I will now try using it in my APP.

Dave.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The synchronization will not work properly if the devices clocks are wrong. Small inaccuracies do not matter.

Each message is time stamped. A message can reach the server many hours after it was actually written to the local db. The server checks the timestamp to decide whether to replace the existing data or not. The newer data is kept.
 
Upvote 0

davelew1s

Active Member
Licensed User
Longtime User
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…