1

I wanna send broadcast over my LAN through Android. I researched online, but ended up with broadcastListener. I know this works for broadcasts in the system among the applications. I am not talking about that.

I wanna send a message to my broadcast ip thus sending all devices connected to my WiFi. Also when other device with my application receives this broadcast should give me a response, a toast or something well that ain't much necessary I guess. I'll create two different activities for listening and sending of the broadcast messages over the network if required.

Is this possible for android.. or am I asking too much Any other suggestions to connect to the device over WiFi if I dunno the ip address of the recipient device

Thanks in advance for the help

AdDe
  • 21
  • 2
  • There is an `Android` framework called [`NSD`](http://developer.android.com/training/connect-devices-wirelessly/nsd.html) that does that, but it's buggy. You might want to take a look at [this](http://stackoverflow.com/questions/34274029/android-stopping-a-bonjour-service-left-running-after-the-parent-process-quit/34372964#34372964) answer of mine with some links to `Google` issue tracker and others. Personally I, after struggling with Nsd, ended up writing `UDP` broadcasting library, just what you're talking about. So answering the question - Yes, it is possible for `Android`. – Onik Jan 23 '16 at 21:13
  • Thanks!! That's partly what I needed. But if I want to send the broadcast to any device not only android, even pc Linux etc can I still use this interface. I searched about this around, I only got androidtoandroid usage. – AdDe Feb 13 '16 at 20:47
  • Kinda new to android – AdDe Feb 13 '16 at 20:47
  • Never tried, but doubt you can do `Android` - PC communication using `NSD`, because the same code should be deployed on PC. You better use non-`Android` specific framework (although can't recommend one) or write your own broadcasting framework that might be used both from your `Android` app and your PC application. – Onik Feb 13 '16 at 21:11
  • Okay. Thanks for the help!! – AdDe Feb 14 '16 at 06:56

0 Answers0