Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get list of all users connected using wifi tethering in android

I am trying to get list of all connected users in wifi tethering. I know that i have to read dnsmasq.leases but the question is, where can I get this file from my mobile?

If i look at source code of wifi tethering open source app

i get the file path in here

this.coretask.setPath(this.getApplicationContext().getFilesDir().getParent());
this.DATA_FILE_PATH+"/var/dnsmasq.leases" 

I might not be using this app for wifi tethering. So then how can i get the file location to read all connected users?

like image 459
Muhammad Umar Avatar asked May 18 '12 03:05

Muhammad Umar


1 Answers

Do not create a dependency of your app on some external app data.

See this link to know how to get the list of connected WiFi devices.

You can use Zero-conf bonjour protocol to discover other devices.

Android application Wi-Fi device - AP connectivity

like image 197
Ronnie Avatar answered Sep 17 '22 02:09

Ronnie