Retrieve IPv6 address for WiFi interface

by IPv6Project » Fri, 20 May 2011 01:26:21 GMT


Sponsored Links
 Dear all !

I am currently developping an application using sockets to communicate
over an IPv6 network.

However I am unable to retrieve the ipv6 address of the WiFi interface
(wlan0).

My code works only for IPv4 :(

Is there anyway to adapt this code to retrieve only IPv6 address
(global) of the wifi interface?

Many thanks in advance,

I am using following code:

private String getLocalIpAddress() {
        try {
            for (Enumeration<NetworkInterface> en =
NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
                NetworkInterface intf = en.nextElement();
                for (Enumeration<InetAddress> enumIpAddr =
intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
                    InetAddress inetAddress =
enumIpAddr.nextElement();
                    if (!inetAddress.isLoopbackAddress()) { return
inetAddress.getHostAddress().toString(); }
                }
            }
        } catch (SocketException ex) {
            Log.e("ServerActivity", ex.toString());
        }
        return null;
    }

-- 



Other Threads

1. Keyboard Gingerbread Bahasa Indonesia

Lancar jaya di evo!  Makasi om!










-- 
===============
"

2. (WTShare) HeyTell for iPhone and Android

cuman mau sharing, lumayan bisa walkie talkie gratisan antaa pengguna iphone
dan android devices
semoga berguna :)

http://gizmodo.com/5743136/heytell-for-iphone-and-android

Phone calls 
suck<http://gizmodo.com/5736678/the-best-part-about-a-smartphone-is-never-having-to-call-anyone>because
you're stuck talking to someone in real time. Text messages suck
because we all have Godzilla thumbs compared to the keys on these ridiculous
touchscreen keyboards. There must be another way. There is! Walkie talkie
smartphones.

[image: HeyTell for iPhone and Android]
What is it?

HeyTell, iPhone and Android,
Free<http://itunes.apple.com/us/app/heytell/id352791835?mt=8>.
Talking will always be faster than typing, but unless you're my Aunt Bettie,
I'm probably not going to actually ring you up to have a conversation.
That's just the way it is. HeyTell, a free app for iOS and Android, lets you
instantly send brief voice messages to other HeyTell app-havers at the touch
of a button. Those soundbites are saved in sequence for later review, and a
slew of in-app purchases lets you do things like add effects to your voice,
broadcast a message to multiple friends, etc. But the gist of it is
essentially turning your phone into an expensive walkie talkie you can use
anywhere, which can be a liberating feeling.
Who's it good for?

People who miss the golden days of walkie talkies; people who despise both
calling and texting; people looking for an easy way to communicate
cross-platform.
Why's it better than alternatives?

It's free, it's simple, and it works. The ability to go back and review
messages will undoubtedly be fun when I start using this when I'm drunk, and
cross platform support should make many roommates/couples/families happy.
How could it be even better?

Setting things up was a little bit wonky couldn't add Jason from my
contacts list and he had to send me an email invite to get things working.
Also, you have to select your name from your own address book when you
start, which is why Jason shows up as "My HeyTell" in my conversations with
him.

-- 
===============
"

3. creating two side by side listViews in android layout

4. Advice on building an SMS/Texting client

5. strange bug on Android

6. Apps Just Become Unpublished

7. Help Bantuan unt unlock htc g2