I need to get the IP of a device that is on the bluetooth tethering hotspot.
In Android 9 and below, I could get the ARP table by doing the following:
var fileReader = new FileReader("/proc/net/arp"); var bufferedReader = new BufferedReader(fileReader);
However, since Android 10 update, the above throws an exception
Java.IO.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied)
I believe this is due to the new Scoped Storage feature.
Many internet blogs believe that adding
android:requestLegacyExternalStorage="true" to the application tag in the manifest will fix that, however it did not.
I can’t find any other way to get the IP of a connected device.
Is there any way to do this in Android 10?