I want to read ip which are connect to my hotspot only on android Q I have a problem : this is a log :
java.io.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied)
and here is what not work :
br = new BufferedReader(new FileReader("/proc/net/arp"));
I add to manifest :
android:requestLegacyExternalStorage="true"
add all permission are granded also I add :
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Settings.System.canWrite(ListOfTerminalsActivity.this)) {
} else {
Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
intent.setData(Uri.parse("package:" + getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivity(intent);
} catch (ActivityNotFoundException ignored) {
}
}
}