Android Tutorial Custom WebSocket Based Push Framework

vfafou

Well-Known Member
Licensed User
Longtime User
@Erel
I'm still testing the framework. Now I have connected ~80 android clients! The server works like a charm and it's very fast!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You can use any database you like. You need to configure the connection pool correctly.
2. Start with the simpler solution which is to push data to all connected devices.
 

vfafou

Well-Known Member
Licensed User
Longtime User
Hi Erel!
Thank you for your reply!
I'm currently pushing the data to connected devices and I have some lags. I need to implement a faster process of refreshing data!
I have 79 static records updated to web socket server database, every time I have changes to a table of my old VB6 application.
When an update occurs, I have to refresh the data to my clients. Now, I'm just sending 79 messages, one for each record...
Which is the best way to go?
 

vfafou

Well-Known Member
Licensed User
Longtime User
Of course, Erel:
B4X:
id = Data.Get("id")
mText = Data.Get("message")

If id <> "" Then
    Log("Message From ID: " & id & ": " & mText)
 
    Select Case mText
        Case "QZ"
            Dim c_zone As ResultSet
            c_zone = Main.ZoneDB.ExecQuery2("select zone_id,zone_st_count from gr_ath_zones_custom where zone_id < 80", Null)
         
            Do While c_zone.NextRow
                dZone  = c_zone.GetInt2(0)
                dQueue = c_zone.GetInt2(1)
                CallSubDelayed3(PushShared, "SendWebClientMessage", "ZR;" & dZone & ";" & dQueue, id)
            Loop
            c_zone.Close
      
       Case...

    End Select
End If

Where "SendWebClientMessage" is:
B4X:
Public Sub SendWebClientMessage(wText As String, wId As String)
    NewMessage(wText, Array As Object(wId))
End Sub
 

vfafou

Well-Known Member
Licensed User
Longtime User
79 and it's not impossible to be added more in the future!
 

vfafou

Well-Known Member
Licensed User
Longtime User
I send those data after client request.
I send 79 messages after every request!
May the clients requesting the data will be more than one at the same moment.
The ideal situation is sending those data to all clients without request and without lags or delays!
 

vfafou

Well-Known Member
Licensed User
Longtime User
Yes, with every request I'm sending those 79 messages to the user requested it. I know it's not a wise decision but I don't know which is the best technique to implement the refresh I want to do!
 

vfafou

Well-Known Member
Licensed User
Longtime User
By the way, from now on the Push Framework Server works with MariaDB 10.0.14.
 

vfafou

Well-Known Member
Licensed User
Longtime User
Hi!
I would like to ask you if you have tried to implement live voice streaming via the framework.
Is it possible to have a real time voice broadcast to all connected users?
What about connections, internet lines and bandwidths?
Thank you in advance!
 

vfafou

Well-Known Member
Licensed User
Longtime User
Hi!
Still testing the framework!
~250 tablets and running perfectly fast!
I'll give the final release of my app within a few days.
I'm sure that the framework will work as fast as now with 300, 400, 600 tablets!
I'll install all my infrastructure to a new dedicated server machine, because it is running on a Mac Mini 2008 now!
Thanks to B4A for this Rapid tool!
Thank you Erel
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…