0

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?

manlio
  • 18,345
  • 14
  • 76
  • 126
ElectronAnt
  • 2,115
  • 7
  • 22
  • 39

1 Answers1

0

Have you tried the ConnectivityManager?

Check this out: Determining and Monitoring the Connectivity Status

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