get list of all users connected using wifi tethering in android
Asked Answered
I

2

12

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?

Incalculable answered 18/5, 2012 at 3:26 Comment(2)
Why are you creating dependency on some external app data.. keep your own listNevarez
@userSeven7s and how can i achieve that? the app who creates his own tethering table will have all the info.Incalculable
N
2

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

Nevarez answered 24/5, 2012 at 8:32 Comment(3)
the simple answer is, your app should create your own routing table instead of getting info from other wifi apps, your own app should connect with other devices then do else procedureIncalculable
Use bonjour for discovering other devices.Nevarez
What if the devices aren't advertising services using bonjour?Ingratiate
S
0

Why don't you make a new file, and catch usernames as they enter the wifi, writing to the file. Then remove names when they leave the wifi, instead of constantly checking names. Maybe check once every 10 seconds? +1 if this helps, -1 if it doesn't.

Sorry for lack of formatting, but I'm on my phone.

Spondee answered 21/5, 2012 at 15:34 Comment(1)
NO that is not what i want. I want to list all already connected tehthered users. In 2.3.3 mobiles, there is builtin tethering option avaliable tooIncalculable

© 2022 - 2024 — McMap. All rights reserved.