android流量统计
来源:互联网 发布:免费杂志编辑软件 编辑:程序博客网 时间:2024/05/10 03:50
android.net.TrafficStats类中,提供了多种静态方法,可以直接调用获取,返回类型均为long型,如果返回等于-1代表 UNSUPPORTED 当前设备不支持统计。
static long getMobileRxBytes() //获取通过Mobile连接收到的字节总数,这里Android123提示大家不包含WiFi
static long getMobileRxPackets() //获取Mobile连接收到的数据包总数
static long getMobileTxBytes() //Mobile发送的总字节数
static long getMobileTxPackets() //Mobile发送的总数据包数
static long getTotalRxBytes() //获取总的接受字节数,包含Mobile和WiFi等
static long getTotalRxPackets() //总的接受数据包数,包含Mobile和WiFi等
static long getTotalTxBytes() //总的发送字节数,包含Mobile和WiFi等
static long getTotalTxPackets() //发送的总数据包数,包含Mobile和WiFi等
static long getUidRxBytes(int uid) //获取某个网络UID的接受字节数
static long getUidTxBytes(int uid) //获取某个网络UID的发送字节数
最后Android开发网再次提醒开发者,TrafficStats类工作在Android 2.2 API Level为8的固件上。
static long getMobileRxBytes() //获取通过Mobile连接收到的字节总数,这里Android123提示大家不包含WiFi
static long getMobileRxPackets() //获取Mobile连接收到的数据包总数
static long getMobileTxBytes() //Mobile发送的总字节数
static long getMobileTxPackets() //Mobile发送的总数据包数
static long getTotalRxBytes() //获取总的接受字节数,包含Mobile和WiFi等
static long getTotalRxPackets() //总的接受数据包数,包含Mobile和WiFi等
static long getTotalTxBytes() //总的发送字节数,包含Mobile和WiFi等
static long getTotalTxPackets() //发送的总数据包数,包含Mobile和WiFi等
static long getUidRxBytes(int uid) //获取某个网络UID的接受字节数
static long getUidTxBytes(int uid) //获取某个网络UID的发送字节数
最后Android开发网再次提醒开发者,TrafficStats类工作在Android 2.2 API Level为8的固件上。
- android流量统计
- android 流量统计
- Android流量统计代码
- android流量统计
- 关于android流量统计
- android流量统计
- Android统计流量 代码
- Android流量统计
- Android流量统计
- android 流量的统计
- android 流量的统计
- android 流量统计
- android流量统计
- android App流量统计
- android 数据流量统计
- android流量统计
- Android流量统计知识点
- Android TrafficStats流量统计
- 建立php开发环境(XAMPP + Xdebug+Zend Studio)
- log4net配置使用说明
- 右键菜单,移动文件到指定目录
- 《Windows程序设计》之数字时钟
- AOP入门
- android流量统计
- 复制构造函数实例
- 宅房日志2012-4-27
- 字符串向前移动的问题
- XMLHttp
- 英特尔的VT-x技术是什么?
- oracle用户创建
- android开发——说说Adapter那些事
- XMLHttpRequest对象