Android的 - 如何通过一个过程跟踪带宽使用率? [英] Android — How to track bandwidth usage by a process?

查看:284
本文介绍了Android的 - 如何通过一个过程跟踪带宽使用率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以跟踪通过 android.net.TrafficStats Android设备的整体和每个UID(应用程序)带宽的使用。
然而,一个UID可以执行多个二进制文件来调用多个进程。

I can track the overall and per uid (application) bandwidth usage of Android device by android.net.TrafficStats. However a uid can execute more than one binaries to invoke more than one processes.

我想知道是否有任何方法或方式每个进程的带宽使用就搞定了,这样我就可以追溯到启动到Internet的连接二进制文件。

I want to know if there is any method or way to get per process bandwidth usage, so that I can trace back the binary that starts the connection to the Internet.

推荐答案

您可能想看看<一个href=\"http://www.binarytides.com/monitor-bandwidth-used-by-each-process-on-ubuntu-linux-with-nethogs/\"相对=nofollow> nethogs 以及其源$ C为Linux $ C 。由于Android在基于Linux内核的,我相信你能以类似的方式实现它。

You may want to have a look at nethogs and its source code for Linux. As Android in built on Linux kernel, I believe that you can implement it in a similar way.

这篇关于Android的 - 如何通过一个过程跟踪带宽使用率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆