Author Options:

Arduino & Android UDP communications? Answered

I have an arduino running a UDP server program and it works fine. I have been able to confirm it receives data and responds with a string by using an app which sends & receives UDP messages.

I am trying to run a UDP client on an android tablet through Eclipse (java). I have imported java.net and java.io and Eclipse does not show any errors with the code. The software seems to timeout after a long period when the following line is executed:
Socket mySkt = new Socket("",8888);

.......even though this is the IP address and port I am able to confirm through the app.

Does anyone have any ideas or very easy sample code to get this to work? Or are there any ways of testing the socket connection?



The forums are retiring in 2021 and are now closed for new topics and comments.

8 years ago