kiran kiran - 1 year ago 100
Android Question

How to display IP address of devices which are connected to android hotspot programmatically?

I need to display ip address of devices which are connected to android hotspot in a app.

Please help me

Answer Source

You have the client info in the system file: /proc/net/arp You will need External Storage permission.

File content example:

IP address       HW type     Flags       HW address            Mask     Device    0x1         0x2         c0:ee:fb:43:e9:f8     *        wlan0

You should parse the file and get the data.

For example, you can try something like that:

public ArrayList<String> getClientList() {
    ArrayList<String> clientList = new ArrayList<>();
    BufferedReader br = null;
    try {
        br = new BufferedReader(new FileReader("/proc/net/arp"));
        String line;
        while ((line = br.readLine()) != null) {
            String[] clientInfo = line.split(" +");
            String mac = clientInfo[3];
            if (mac.matches("..:..:..:..:..:..")) { // To make sure its not the title
    } catch ( aE) {
        return null;
    return clientList;

***Tested on rooted device.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download