Android:監控應用程序的數據流量使用情況 (Android: Monitor an app's data traffic usage)


問題描述

Android:監控應用程序的數據流量使用情況 (Android: Monitor an app's data traffic usage)

Ok, I know the question is not directly to the point (the kind of questions I prefer asking), but here goes: Can anyone point med in a good direction for learning how I can monitor the data traffic generated by an app? I need to do it in such detail that I can see exactly how much data is transferred to and fro the device when f.ex. clicking an "Update" button in the app which updates rows to/from a remote database.

Whether I should implement the monitoring in the application I'm monitoring, or perhaps as a separate application which I can tell to monitor THAT exact application's data traffic, I'm not sure. Both ways is of interest.

Thanks in advance for all hints/tips/help.


參考解法

方法 1:

  

Can anyone point med in a good direction for learning how I can monitor the data traffic generated by an app?

If you mean at development time, you can use the Network Statistics tab in DDMS. Note that if you do not see this tab in the DDMS perspective in Eclipse, you will need to open the view (Window > Show View > Other > Android > Network Statistics).

If you mean at runtime, you can use TrafficStats. It may not work on all devices, simply because measuring per-app (or, more accurately, per-UID) traffic data is not universally available, even on devices that have the TrafficStats class, but it's the only game in town.

(by user1341676CommonsWare)

參考文件

  1. Android: Monitor an app's data traffic usage (CC BY-SA 3.0/4.0)

#network-traffic #data-transfer #Android






相關問題

網絡流量操縱(虛擬局域網) (Network traffic manipulation (Virtual LAN))

如何在linux中了解特定端口的流量 (How to know traffic to a specific port in linux)

僅嗅探/記錄應用層 (Sniffing/recording application layer only)

Android:監控應用程序的數據流量使用情況 (Android: Monitor an app's data traffic usage)

如何按時間從android獲取trafficStats信息? (How to get trafficStats information from android by time?)

在 FreeBSD 中使用 SSH 隧道進行所有流量轉發 (All traffic forwarding using SSH tunnel in FreeBSD)

Wireshark - 僅查看多播和廣播流量 (Wireshark - see only multicast and broadcast traffic)

java套接字中的奇怪流量 (Strange traffic in java sockets)

是否有任何程序可以模擬不穩定的網絡連接? (Are there any programs that can simulate an unstable network connection?)

獲取 XHR 響應(網絡流量)並在 Katalon Studio 中解析 (Get XHR response (network traffic) and parse it in Katalon Studio)

Visual Studio 2019 中的網絡流量工具在哪裡 (Where's the Network Traffic Tool in Visual Studio 2019)

為什麼我不能用 chrome 調試 Service Worker? (Why I can't debug Service Workers with chrome?)







留言討論