[android-developers] How to make network reconnection in the app of c/s?

2010-11-15 Thread Jenus Dong
Hi, all Such like messager app, client/server framework, using tcp long connection using heart beating packet. Cause TCP connection, so when local network is diable or changed, connection would be disconnected. But to the client, it may not be known right now till the next interaction with the

Re: [android-developers] How to make network reconnection in the app of c/s?

2010-11-15 Thread Miguel Morales
Something like this wouldn't be hard to implement in your application. Android offers several classes that will help you in probing for the state of the network connection, wifi connection, etc. If what you're doing is just regular socket TCP communication simply wrap your communication in an

Re: [android-developers] How to make network reconnection in the app of c/s?

2010-11-15 Thread Jenus Dong
Thanks, Miguel Morales. When network disconnected, the code will check right now. Yes, now start the timer to connect periodically till it connect successfully. It works. After googling, Android has one manager, ConnectivityManager, can detect the network information. So can check the available