[英]Android — How to track bandwidth usage by application programmatically
I want measure bandwidth that my application used through mobile data or wifi? 我想通过移动数据或wifi使用我的应用程序使用的测量带宽?
I have seen there is a TrafficStats class from android API 8 , How can I use this in lower android API like from 4. 我已经看到有一个来自android API 8的TrafficStats类,我如何在较低的android API中使用它,如4。
Is there any class or source code that can do this? 有没有可以做到这一点的类或源代码?
any help would be appreciate. 任何帮助都会很感激。
Thanks 谢谢
How about logging how much data you send and receive to a database which you can later export? 如何记录您发送和接收的数据量,以便以后导出数据库? Or save to a file on SD card (if there is one). 或者保存到SD卡上的文件(如果有的话)。
I have seen there is a TrafficStats class from android API 8 , How can I use this in lower android API like from 4. 我已经看到有一个来自android API 8的TrafficStats类,我如何在较低的android API中使用它,如4。
You can't, sorry. 你不能,抱歉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.