Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Developer
osus
Posts: 213
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Network Interface IP Address

Hi !

 

Is there a way to find local ip on network interfaces?

I've tried standar Android code and can not get anything useful:

 

                ArrayList<NetworkInterface> nis = Collections.list(NetworkInterface.getNetworkInterfaces());
                final int len = nis.size();
                for (int j = 0; j < len; j++) {
                    NetworkInterface ni = nis.get(j);

                    Log.d("NET", ni.getDisplayName());
                    
                    for (Enumeration<InetAddress> nis2 = ni.getInetAddresses(); nis2.hasMoreElements():smileywink: {
                        InetAddress ia = nis2.nextElement();
                        if (!ia.isLoopbackAddress()) {
                            if (ia instanceof Inet6Address) {
                                continue;
                            }
                            Log.d("NET", ia.getHostAddress());
                        }
                    }
                }

 

gets no ipaddress.

Is there a way to get it?

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Please use plain text.
Developer
osus
Posts: 213
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: Network Interface IP Address

Hey guys, no answer?

Is there no way to get active interface?

Android runtime is supposed to be connected to a virtual wifi point but no way to get that interface.

 

 

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Please use plain text.