Android Question CloudKVS - how to decrease information exchange delay between client and server?

amorosik

Expert
Licensed User
CloudKVS tutorial

In order to speed up the exchange of information, I experimented with the examples attached to the project description
In particular, on the Android client project, on Starter service I tried to decrease the refresh time to 0.001
Starter / Service_Create:
Sub Service_Create
    ckvs.Initialize(Me, "ckvs", Main.ServerUrl)
    ckvs.SetAutoRefresh(Array(Main.user), 0.001)
    End Sub

B4J Client:
Public Sub Initialize (Callback As Object, EventName As String, ServerUrl As String)
    csu.Initialize
    sql.InitializeSQLite(File.DirApp, "db.db", True)
    CreateDatabase
    url = ServerUrl & "/action"
    autoRefreshTimer.Initialize("AutoRefresh", 1000)
    mCallback = Callback
    mEventName = EventName
    HandleQueue
    If False Then CallSub(Me, "HandleQueue") 'to avoid obfuscation issues
End Sub

Is it the correct way to increase the performance of data exchange between server and client?
What is the drawback of decreasing this time too much?
And how to increase performance between client and server?
autoRefreshTimer.Initialize("AutoRefresh", 1000) is the correct line?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
What is the drawback of decreasing this time too much?
Not too significant. It means that the clients will be sending "refresh" requests all the time. The clients code will not send multiple requests at a time so it is not too bad.

autoRefreshTimer.Initialize("AutoRefresh", 1000) is the correct line?
No need to change the client code. It is enough to call SetAutoRefresh with a low value.
 
Upvote 0
Top