You can use WifiManager.getConnectionInfo().getIpAddress().

You can convert this to a String with:

    private static String ipAddressToString(int addr) {
        StringBuffer buf = new StringBuffer();
        buf.append(addr  & 0xff).append('.').
            append((addr >>>= 8) & 0xff).append('.').
            append((addr >>>= 8) & 0xff).append('.').
            append((addr >>>= 8) & 0xff);
        return buf.toString();
    }

jason

On Tue, Dec 2, 2008 at 12:26 PM, Andrea <[EMAIL PROTECTED]> wrote:

>
> Ralf: Yes, I need to know it programmatically because I have to accept
> incoming connections on my phone.
>
> On Dec 2, 7:11 pm, Ralf <[EMAIL PROTECTED]> wrote:
> > On the device, go to the wifi settings and select the connected wifi
> > network. It will show you its IP address.
> >
> > If you mean programmatically, sorry, I do not know.
> >
> > R/
> >
> > On Mon, Dec 1, 2008 at 2:49 AM, Andrea <[EMAIL PROTECTED]> wrote:
> >
> > > How can I get the Ip address assigned by a WiFi network to which my
> > > device is connected?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to