문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top