如何通过Wi-Fi从其他应用程序获取传输的数据量? [英] How to obtain amount of transferred data through Wi-Fi from other applications?

查看:165
本文介绍了如何通过Wi-Fi从其他应用程序获取传输的数据量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在面临这一问题。我通过搜索一些 API 东西的使用有可能通过Wi-Fi从其他应用程序(如何截图娄获取传输的数据花了很多时间显示)。

I'm facing to this problem. I spent much time by searching some API or "something" with it's possible to obtain transferred data through Wi-Fi from other applications (how screenshot bellow shows).

是否有人知道的方式该怎么办呢?在这里的人谁尝试过(或已经完成)类似的东西?还是有点不同:?这是可能做到这一点

Does someone know a way how to do it? Is here someone who tried (or has already done) for something similar? Or a little differently: Is this possible to do it?

目前我觉得<​​STRONG>这是不可能,因为我认为,非系统应用程序无法检索安装在设备的其他应用程序(S)的数据。但也许我可以的失踪的东西,所以我放在这个问题,会很高兴的任何建议。

Currently i think that this is not possible because i think that non-system application cannot retrieve data from other application(s) installed on device. But maybe i can "missing" something so i placed this question and will be glad for whatever suggestion.

在此先感谢!

推荐答案

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.

这意味着你可以使用 getUidTxBytes ,以获得整个传输的数据,到目前为止, getUidRxBytes ,以获得整个接收的数据。

This means you can use getUidTxBytes to get whole transmitted data and so far getUidRxBytes to get whole received data.

,你可以得到应用程序的 UID

And you can get application's UID with:

getApplicationInfo().uid 

或用于其它应用参照<一href=\"http://stackoverflow.com/questions/6875916/how-to-get-uid-value-of-an-android-application-from-a-list-displayed-in-a-spinne\">THIS

这篇关于如何通过Wi-Fi从其他应用程序获取传输的数据量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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