Android Question WIFI freeze

mauro vicamini

Active Member
Licensed User
Longtime User
Hi,
I've a problem with an application that I've developed to display some information on a tablet by a server application. The tablet connect a nodejs server and wait for some information coming from the server and when the information arrive the tablet display the information for some seconds and then clear the display showing a default waiting message. All works great in my tablet with android 4.0 but when I use tablets with android 4.1 and greater the application seems to don't recive nothing anymore after some minutes (perhaps about 20 minutes).
In the application I've put both KeepAlive(True) (for not turning off the display) and the PartialLock (for not going to sleep the CPU). Infact with Android 4.0 the application doesn't turn off the display and it's always responding to the incoming data even after long time of no data trafic even if there is set to "never" the advanced property of "Keep WI-FI ON during sleep". It works exactly as I want. But with Andorid 4.1 and greater if the server waits for too much time (like I've said before about 20 minutes) the application doesn't recive the incoming data even if the display is always on.
I've also introduced in the application a kind of heart-beat so the server application sends each 20 seconds a dummy data packet that the tablet application recives and process but not made to display somthing, just for keeping alive the socket, but it seems to don't produce any kind of effects.
The other strange thing is that I've also a label that indicates if the TCP connection is on or off and it shows always on. The only thing that I could not check at the moment is if the value of "Keep WI-FI ON during sleep" on the tablets with Andoid 4.1 and greater because are by my costumers and actually are closed. But as in Android 4.0 it works great indipendently from the value of "Keep WI-FI ON during sleep" I aspect that it does the same also with 4.1 and greater.

Can anyone suggest me any solutions?

I hope I was clear.

Thanks a lot for the attention.
 

sorex

Expert
Licensed User
Longtime User
someone else reported something simular a while ago.

he "solved" it by disabling an re-enabling wifi every 10 minutes or when a copy of data failed.
 
Upvote 0

mauro vicamini

Active Member
Licensed User
Longtime User
someone else reported something simular a while ago.

he "solved" it by disabling an re-enabling wifi every 10 minutes or when a copy of data failed.
Thank you Sorex for your fast reply!
What do you mean with "re-enabling" wifi ? Just close the tcp connection and then re-open it or somthing different?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
he actually turned off the entire wifi and re-enabled it.

he lost local lan IP address and everything when his problem happend.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
nah, it's just a matter of a few seconds. :)

instead of erasing your screen and pulling in data you should pull in data first.
Iis there nothing new or no connection you just keep displaying what is already there.
 
Upvote 0

mauro vicamini

Active Member
Licensed User
Longtime User
nah, it's just a matter of a few seconds. :)

instead of erasing your screen and pulling in data you should pull in data first.
Iis there nothing new or no connection you just keep displaying what is already there.
I cannot let display the last information because are information from an access control system so for privacy I cannot let display the information of the last person entered. I show the informations for just few seconds.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I suggest you give it a try.

if download fails turn of and back on wifi and it will try again when the timer gets hit for the next update.
 
Upvote 0

mauro vicamini

Active Member
Licensed User
Longtime User
if download fails turn of and back on wifi and it will try again when the timer gets hit for the next update.
It's the server application that sends through the opened socket the informations at the right time, it's not the tablet application that poll for the data.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
well, then you reopen the socket to the server again once the wifi has an IP address again.
 
Upvote 0
Top