I\'m using Android with Api level 8 and I want to get the Address of my Ethernet interface (eth0).
On API level 8, the NetworkInterface class don\'t have the function ge
this way to use java fix it; maybe can help you
NetworkInterface netf = NetworkInterface.getByName("eth0");
byte[] array = netf.getHardwareAddress();
StringBuilder stringBuilder = new StringBuilder("");
String str = "";
for (int i = 0; i < array.length; i++) {
int v = array[i] & 0xFF;
String hv = Integer.toHexString(v).toUpperCase();
if (hv.length() < 2) {
stringBuilder.append(0);
}
stringBuilder.append(hv).append("-");
}
str = stringBuilder.substring(0, stringBuilder.length()- 1);