I implemented codes for receiving multicast diagram. My phone can get a diagram when screen is on.
However when screen is off, phone does not get any diagram from subnet. (PC sends a diagram on subnet for searching phone.) I though that multicast lock api(WifiManager.MulticastLock) can solve this problem, but it does not work.
How can I listen multicast diagram, phone screen is off ?
You will also need a
WakeLock
and perhaps also a regularWifiLock
.WifiManager.MulticastLock
will not keep the device powered on and may not keep the WiFi radio powered on.