Hi Erel, thanks for reply
,
do you mean to use B4J to forward the connection ?
I already tried it but with no success....
Here my develops....
I've read that this is a known Emulator bug, after that I've read and applied a small guide and now I can receive UDP packets sent from ESP8266 on emulator in my app, but probably because I launch emulator in the terminal by disabling default WiFi, it can only receive and cannot respond to ESP8266.
Here a guide I follow to get it receive, please see last 2 posts:
https://stackoverflow.com/questions/65918070/how-to-get-udp-data-from-pc-to-android-emulator
So I used telnet to connect to emulator (127.0.0.1:5554) and redirect ports...
After that I managed with B4J (before your advice
) to get the final UDP data packet routing, but I'm confuse here and created two different UDP sockets, one listen ESP and send to emulator (127.0.0.1:8888) and one listen emulator and send to ESP.
ESP send data to port 8888 and listen on port 8889 for replies.
My app on emulator listen on port 8888 and send replies to ESP requests on port 8889, ESP8266 IP Address 192.168.178.38.
As expected my code does not work
It only work receiving packets but cannot send. To get it working I used a small port forwarding found on the web, but it does not provide a way to get responses. You can find it on bottom of link I posted.
Would be useful have a simple B4J app that can do it without manage telnet and other things any time we need to connect to an emulator and get replies, so engaging a bidirectional comunication. This can be useful for TCP & UDP sockets, as well for webserver, websocket and other useful things.
This just for debugging purpose instead of using real device ....
I've attached my simple B4J project if you want better know what I do.
Thanks.