Using ARP table we can access IP and MAC of hotspot connected devices in Android 9 and earlier versions. Now from Android 10 permission denied for the same. Kindly suggest how can I access IP and MAC address of connected devices in Android 10. Below Code working in up-to Android 9 Version but not work in Android 10.
BufferedReader br = new BufferedReader(new FileReader("/proc/net/arp"));
String line;
while ((line = br.readLine()) != null) {
String[] clientInfo = line.split(" +");
if(!clientInfo[3].equalsIgnoreCase("type")) {
String mac = clientInfo[3];
String ip = clientInfo[0];
textView.append("\n\nip: " + ip + " Mac: " + mac);
Log.d("IP : ", ip);
Log.d("Mac : ", mac);
}
}