简体   繁体   中英

android - monitoring WiFi traffic and packets

I need to write an app which is going to connect to a specific WiFi network (given an IP address/name) and "listen" (monitor) to the network packets under that WiFi.

Eventually, I should be able to detect specific packets and act accordingly.

I want to write the app myself, so what tools/libraries are out there to monitor traffic? (stuff like PCAP.net in C#).

and one more question, is it possible for me to detect all the packets under that network? or just the ones that I send/receive?

thanks! just trying to see what libraries are out there and to hear from people with some experience...

You can use Android's TrafficStats class to monitor traffic.

From Android Developer's about TrafficStats:

Class that provides network traffic statistics. These statistics include bytes transmitted and received and network packets transmitted and received, over all interfaces, over the mobile interface, and on a per-UID basis.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM