views:

22

answers:

1

Hi, I am developing a network app for Android and I'm still stuck on connecting my real Android device with an device-emulator running on my desktop computer.

I've created private network with a router, so the only ones connected to the network are my pc and my mobile phone, in order to avoid firewall/closed ports problems.

My PC ip is 192.168.1.100 and I'm trying to ping each other so I can sea reachability of each network node. Ping works fine from my PC (not the emulator console) to the phone.

The problem is that I want to ping the PC-emulator from my mobile phone, not the PC itself... For that, I use the emulator console... Should I use my computer IP or should I use another one? I've seen some ip's like "10.0.x.x" here http://developer.android.com/guide/developing/tools/emulator.html

But I guess those are for connecting two EMULATORS, right?

Besides, I've tried to connect them by socket, creating a redirection for the port via Emulator console, but still can't connect them.

Any clues? Thanks!!

A: 

I've reached the conclusion that emulator can only receives packets coming from the loopback (127.0.0.1), since when you issue "redir add tcp:port:newPort, it only redirects the first port (associated to the loopback) to the second port (associated to the "emulator virtual ip").

I've tried to create a bridge, which redirects all the packets coming to my pc to the IP 127.0.0.1, but still not works. Thus, I think the emulator has been developed only to communicate with other emulators...

I hope anyone that comes here contradicts me.

Pedriyoo