Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm sending UDP packet to android over a wireless network from some other software . how can I receive that in android ? should I write a client in android to get the data?

share|improve this question

closed as off topic by Tetrad Apr 12 '12 at 15:36

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
There's nothing specific to game dev in this question, and there are similar questions already asked on SO (like stackoverflow.com/questions/3102048/…) –  Tetrad Apr 12 '12 at 15:36

1 Answer 1

You need to set up a DatagramSocket to receive DatagramPackets via UDP. There's an example in this SO question.

share|improve this answer
    
but would it get the packet from network ? it does not matter who sends these packets? –  matarsak Apr 12 '12 at 14:27
1  
Part of setting up the DatagramSocket is defining what you are listening for... as in, the IP and PORT you expect to be getting packets to and from. –  Myrddin Emrys Apr 12 '12 at 14:53
    
Generally telling people to google things in your answer body isn't a good idea. Shout at him in the question comments instead :). –  Jonathan Dickinson Apr 12 '12 at 15:25
1  
@matarsak how UDP works is extremely well documented on the internet - and they explain exactly how the packets arrive (answer: you get every packet that arrives on that NIC on that port - you need to decide if you want the packet). In addition as stevehb originally pointed out searching on Google got him the answer for Android straight away. You will continue to get short answers like this (or none at all) if you ask things that are so easy to find out yourself. –  Jonathan Dickinson Apr 12 '12 at 15:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.