March 28th, 2012, 08:48 AM
Access Point Change detection
My application has to open a socket and send/receive some message to the server. This works fine but the problem is when I move inside the building, then the device changes from one access points to the other (same wifi network). In that moment, I have (1) to store the messages, (2) create again the socket and (3) send stored messages. I not able to recognize that moment and I am not storing all the messages. I detect “A Connection timed out” exception in the BufferedReader and then I start storing messages.
I have tried to detect that moment by this registering to this Intents but I am still missing messages:
//To detect Connectivity changes.
cmReceiver = new connectionChangeReceiver();
intentFilter intentFilter = new IntentFilter();
Thank you so much