Question

I am currently working on using multicast on a network to send a message (from one Android Device) on the network to all other Android devices including itself.

It works as required when both phones are connected via the local WiFi network. I.e Phone A send message and both Phone A and phone B receive the message. However, the ultimate goal is to have the phones connected via WiFi-Direct.

Therefore I connected both devices together and tried the same process again but this time only the phone that sends the packet that I'm broadcasting receives it. I.e. Phone A sends the message and receives it but phone B does not receive the message from phone A.

My ultimate question therefore is does Multicast work when using WiFi-Direct between Android devices or not? Has anyone else experienced problems with WiFi-Direct and Multicast on the Android platform?

Was it helpful?

Solution

A similar question has been asked, please see my answer there: Android Wi-Fi Direct Network

To sum up: Multicast should work on Wi-Fi Direct in theory, but some Android devices block incoming non-unicast traffic on the stack level. Since you already have it working on the devices when using normal Wi-Fi, it seems to be another issue. Do make sure that you acquire a MulticastLock. I provided an alternative solution using unicast in the linked answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top