如何找到无线和网络数据使用率分别由android系统中特定的应用? [英] How to find wifi and network data usage separately by particular application in android?

查看:205
本文介绍了如何找到无线和网络数据使用率分别由android系统中特定的应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

recived = TrafficStats.getUidRxBytes(uid);
send = TrafficStats.getUidTxBytes(uid);

TrafficStats.getMobileRxBytes(); 
TrafficStats.getMobileTxBytes(); 

TrafficStats.getTotalRxBytes();
TrafficStats.getTotalTxBytes();

我有应用程序ID,我可以得到该应用程序的数据使用情况,但我不能使用WiFi和网络获取信息,更详细的数据一样使用。我想单独找无论是在设备的所有安装的应用程序。我怎么能找到?我已经尝试了很多东西,但没有获得任何解决方案。

i have application id and i can get that application data usage but i cant get information in more detailed like data usage using wifi and network. i want to find both separately for all installed application in device. how can i find that.? i have already tried many things but didn't get any solution for that.

推荐答案

我认为你应该使用另一种方法,获得流量通过UID,例如 - getUidRxPackets(INT UID)

I think you should use alternative way, get traffic by UID, for example — getUidRxPackets(int uid)

也是有帮助的(如何获取UID):(如何得到安装在Android手机的所有应用程序)

Also helpful (how get UID): (How to get all apps installed on android phone)

编辑:

你能告诉我,我怎么能确定有多少数据通过无线网络使用,   移动。??

can you tell me how i can determine how much data use by wifi and mobile.??

有一个很好的答案 - <一个href="http://stackoverflow.com/questions/12613402/android-statistic-3g-traffic-for-each-app-how">android每个APP统计3G流量,怎么样?看他的逻辑。

There a nice answer — android statistic 3g traffic for each APP, how? look his logic.

这篇关于如何找到无线和网络数据使用率分别由android系统中特定的应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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