Android Tutorial Custom WebSocket Based Push Framework

DonManfred

Expert
Licensed User
Longtime User
I really should understand the system....

The external message does not reactivate a connection!
The incoming message wake up (or starts) your app. Once your app is started it is up to YOU then to do whatever you need to do to sync your database or whatever you(your app) wants to do...
 

LucaMs

Expert
Licensed User
Longtime User
You can also use StartServiceAt to start the process at a specific time.
Maybe I'm lost somewhere (missing the meaning of some post) but I'm reading the PushService service and it works exactly using StartServiceAt.

1) PushService starts at boot
2) it is a sticky service
3) it uses StarServiceAt (every 2 minutes)
4) it tries to connect to the server, if the connection is not already active
5) it reads and shows messages stored locally (if exist)
6) it can receive new messages from the server, without starting some "listening method", thanks to the websocket (the server "runs" wsh_NewMessage)

So, I don't understand Roberto's question...
For further discussion please start a new thread.
... please, start a new thread also in the Italian forum
 
Last edited:

tigrot

Well-Known Member
Licensed User
Longtime User
If you don't need a real time response, yes. I close connection and every now and then i get a web page to see if the server has data waiting for me. Also "institutional" push notification services are unable to contact the client if the client is not connected at that time. And connection must be handled automatically or manually, since TCP is not able to reveal connecction's drops real time.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…