views:

203

answers:

2

How can I find the IP address of the an HTC incredible connected to Verizon's network? My other question - do I have to make any changes to my App to run it on a cellular network? Till now the App was running on a Nexus One connected to a local Wi-Fi network.

Thanks.

A: 

Hi,

  1. To get IP address info look at this example. Might need a tweak for your CDMA.

  2. You need not modify anything to get it working on Mobile n/w

Vinay
I know how to get the IP assigned by the Wi-Fi network. I'm interested in the IP that is assigned by the mobile service provider (Verizon in this case.)
Soumya Simanta
A: 

You can use NetworkInterface.getNetworkInterfaces();, then addresses = intf.getInetAddresses(); to enumerate all the IP addresses on all the interfaces. You're looking for an address associated with a PDP.

That should work. I'm currently looking for a neater way.

Philip Pearl