Note that there are some explanatory texts on larger screens.

plurals
  1. POmulticastlock not working on Android 2.2 phone
    primarykey
    data
    text
    <p>I need to be able to receive broadcasts on the Wifi of this phone. It's an HTC Desire, about 2 years old, running Android 2.2.</p> <p>I've followed the docs and some example code I found, and ended up with this code to enable the multicast:</p> <pre><code>mWifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE); WifiManager.MulticastLock multicastLock = mWifiManager.createMulticastLock("net.inside.broadcast"); multicastLock.setReferenceCounted(true); multicastLock.acquire(); Log.i("BCXXX", "multicastLock.isHeld() = " + multicastLock.isHeld()); Log.i("BCXXX", "multicastLock.toString() = " + multicastLock.toString()); </code></pre> <p>The log output follows here:</p> <pre><code>I/BCXXX ( 3302): multicastLock.isHeld() = true I/BCXXX ( 3302): multicastLock.toString() = MulticastLock{ 45fa2b88; held; refcounted: refcount = 1 } </code></pre> <p>This seems to confirm that the multicastLock should be held, meaning multicast should work. However, it doesn't. The Android app simply does not receive any broadcast packets except for its own, i.e. the one it sends out to the others. The other machines I should mention can see the Android phone just fine and receive its broadcast messages. I've tried addressing the packets to 255.255.255.255 as well as 192.168.0.255 (with 192.168.0. obviously being the net everyone is connected to in the LAN).</p> <p>This is a project built with Unity 3.5 and both the Windows and OS X builds work as expected. The Android plugin does get called (as is evident from the log entries).</p> <p>Any ideas anyone?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload