List of usage examples for android.net LinkProperties getAddresses
@UnsupportedAppUsage
public @NonNull List<InetAddress> getAddresses()
From source file:com.compal.telephonytest.TelephonyTest.java
private static String formatIpAddresses(LinkProperties prop) { if (prop == null) return null; Iterator<InetAddress> iter = prop.getAddresses().iterator(); // If there are no entries, return null if (!iter.hasNext()) return null; // Concatenate all available addresses, comma separated String addresses = ""; while (iter.hasNext()) { addresses += iter.next().getHostAddress(); if (iter.hasNext()) addresses += ", "; }/*from w w w . ja va 2 s .co m*/ return addresses; }