Android SDK - is multicastlock working? it does not work when screen is off!

1k views Asked by At

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 ?

1

There are 1 answers

2
CommonsWare On BEST ANSWER

You will also need a WakeLock and perhaps also a regular WifiLock. WifiManager.MulticastLock will not keep the device powered on and may not keep the WiFi radio powered on.