3

I'm trying to call "arp -a" on my android device, but since it only works for pc - how do i change this? Is there a way to access a list of the ip-addresses, that arp -a gives you, but on android instead?

My code is like this on the android device:

try {

        Process process = Runtime.getRuntime().exec("arp -a");
        process.waitFor();
        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
        int i = 0;
        while (reader.ready()) {
            i++;
            String ip = reader.readLine();
            if (i >= 4) {
                ip = ip.substring(2, 15) + "\n";
            }
        }
    } catch (IOException | InterruptedException ioe) {
        ioe.printStackTrace();
    }
Cœur
  • 37,241
  • 25
  • 195
  • 267
Anders Lassen
  • 615
  • 2
  • 8
  • 20

1 Answers1

-1

Install busybox and some terminal emulator, connect to Wi-Fi and you are done.

Andre Lopes
  • 99
  • 1
  • 4