I have a service on Android that listens and responds to packets it receives via multicast.
This works most of the time, but unfortunately, I\'m finding that every n
Note: This answer was meaningful when the question was asked in 2010, it is probably irrelevant today.
I would think that changing wireless networks is pretty much akin to disabling and re-enabling the network (likely with a different IP and routing), so no surprise that things break.
Perhaps registering for changes in the network info would give you the needed warning?
http://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION
and associated pages
Are you acquiring a multicast lock?
WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
MulticastLock lock = manager.createMulticastLock("lock name");
lock.setReferenceCounted(true);
lock.acquire();
It also seems like certain devices block multicast:
Multicast on Android 2.2