I’m developing an application that is sending data through tcp/ip
I’ve made my own Name server that the clients register their IP and listening port. All of this is working very well.
Right now the clients send a ping to the server to get the latest IP and updates it if necessary. Since the app is already using quite allot of network I would prefer to minimize it as much as possible.
My question is if the ConnectivityManager (or any other service) sends a broadcast when the IP changes? Or is this not possible for the phone to detect this locally?
For this you need run an service as background with the help of BroadcastReceiver,place the initial IP on DB or some shared preferences,check and update your IP by using background service.Refer the services here http://www.vogella.de/articles/AndroidServices/article.html