How to get the Android Emulator's IP address?
in
Android Processing
•
2 years ago
Hi, I'm trying to let Android and Arduino exchange data directly by IP. After 3 weeks work, it's ok to send OSC message from Android emulator to Arduino with Ethernet Shield. also,processing can receive OSC message from Arduino.
But the problem is, when run the Processing Sketch on Android emulator, it can not receive OSC message from Arduino.
But the problem is, when run the Processing Sketch on Android emulator, it can not receive OSC message from Arduino.
this is data sending part from Arduino:
- byte myMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
- byte myIp[] = { 131,113,xxx,xx7 }; // IP for Arduino with Ethernet Shield
- byte destIp[] = { 131,113,xxx,xx5 };// IP for Processing sketch
- int destPort = 12000;
- int serverPort = 12000;
this is data receiving part from Processing for Android:
- oscP5 = new OscP5(this,12000);
- myRemoteLocation = new NetAddress("131.113.136.217",12000);
run the processing sketch on laptop it works very well(send and receive),
but when run it on Android emulator,it does not work.(send is ok, receive doesn't work)
processing console information shows like this:
" INFO @ OscP5 is running. you (127.0.0.1) are listening @ port 12000"
Guess is about IP address, cause i use specific IP address to send and receive OSC message between them.
but now the emulator use localhost address, does Emulator has IP address like this " 131,113,xxx,xx5 "?
processing console information shows like this:
" INFO @ OscP5 is running. you (127.0.0.1) are listening @ port 12000"
Guess is about IP address, cause i use specific IP address to send and receive OSC message between them.
but now the emulator use localhost address, does Emulator has IP address like this " 131,113,xxx,xx5 "?
any ideas? any advices?
I'll post the working code after solve this problem. thanks so much.
3