I am working on an android app that based on java that need the list of devices connected to hotspot which has been using arp table and ip neigh command. In the target SDK version 33, arp table and ip neigh are both not working. My app will need the IP and MAC Address of the devices while pinging the subnet mask can only know the IP Address of the devices.
BufferedReader br = null;
List<String> args = new ArrayList<String> ();
args.add("ip");
args.add("neigh");
String args = listOf("ip", "neigh");
ProcessBuilder cmd = new ProcessBuilder(args);
Process process = cmd.start();
br = new BufferedReader(new
InputStreamReader(process.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println("line="+line.toString()); }
BufferedReader errReader = new BufferedReader(new
InputStreamReader(process.getErrorStream()));
br.close();
errReader.close();
process.destroy();
Is there any alternative to get the list of devices connected to hotspot without root?