Android流量统计TrafficStats类的使用(Android2.2后可用)
来源:互联网 发布:acs数据库官网 编辑:程序博客网 时间:2024/06/04 19:54
Android流量统计来说在2.2版中加入了TrafficStats类可以轻松获取,其实本身TrafficStats类也是读取Linux提供的文件对象系统类型的文本进行解析。android.net.TrafficStats类中,提供了多种静态方法,可以直接调用获取,返回类型均为long型,如果返回等于-1代表 UNSUPPORTED 当前设备不支持统计。
static long getMobileRxBytes() //获取通过Mobile连接收到的字节总数,不包含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类的使用(Android2.2后可用)
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android流量统计TrafficStats类的使用
- Android SQLite分析
- Safe3 Web漏洞扫描系统企业版v7.1
- Android中数据存储的5种方法
- java的栈与堆区别
- Web杀毒v3.3.1
- Android流量统计TrafficStats类的使用(Android2.2后可用)
- 【转】t-SQL打印杨辉三角
- 域控制器灾难恢复 邮件系统灾难恢复
- .net版本发展历程
- keil与汇编混合编程
- 嵌入式控制器的输入端口设计分析
- OCSSD.BIN Process is Running in a Non-RAC Environment
- 深入理解 GNU GRUB - 02 boot.S 2.1 相关BIOS例程
- WEBOS——第一次感觉云计算离我们如此之今