The IP address of the emulator is normally hard coded to
10.0.2.15
You can get the IP address with implementing a method geLocalHostIp()
public static IpAddress getLocalHostAddress() {
InetAddress ipAddress=null;
/** Detects the default IP address of this host. */
try {
Socket conn = new Socket("www.google.com", 80);
ipAddress = conn.getLocalAddress();
Log.d(TAG,"getLocalHostAddress returned: " +
ipAddress.toString());
conn.close();
} catch (Exception e) {
Log.d(TAG,"getLocalHostAddress failed: ");
return new IpAddress("127.0.0.2");
}
return new IpAddress(ipAddress);
}
--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.
On Jun 9, 11:35 am, "[email protected]"
<[email protected]> wrote:
> I am running a server application on emulator. I want to connect to
> the server through a client application running on other system.
> How to get the IP of the emulator and what should be the http-proxy ip
> of the emulator.
> Any help is appreciable.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---