I have written an application using websocket protocol. I want to ensure a persistent connection for my application. I have the phone vibrate when it has successfully connected to my server. Right now, it works whenever I make a connection through wi-fi, but whenever I turn the wi-fi off, connection fails over the 4g service. Moreover, if I then turn the wi-fi on, the phone vibrates. Are there special events that I have to handle to ensure connectivity over 4g/3g services?
Asked
Active
Viewed 447 times
1 Answers
0
Have you tried the ConnectivityManager?
Check this out: Determining and Monitoring the Connectivity Status

Void Main
- 2,241
- 3
- 27
- 36