Is there any way to get a the list of connected MAC addresses when my phone is on Wi-Fi tethering mode?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Firstly, you must have a rooted device. When it's done just read dnsmasq.leases file. Usually it is placed at: /data/misc/dhcp/dnsmasq.leases. A structure of the file is pretty simple - each line is a summary of a connected user. The summary has several fields including MAC. I didn't find a possibility to get MAC without root. Please correct me if I'm wrong.
Reading
/proc/net/arp
would provide the information for both static and DHCP clients that have communicated with the device during the last 60 seconds (configured in/proc/sys/net/ipv4/neigh/wl0.1/gc_stale_time
wherewl0.1
is the wireless network interface on my phone).It is available for non-root users too.
//--------------------------------------------------------