无线/移动网络获取数据的速度编程 [英] Getting data speed of wifi/mobile network programatically
本文介绍了无线/移动网络获取数据的速度编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何获得无线/移动网络的数据传输速度以编程方式在我的应用程序。 在此先感谢!
How do I get the data speed of wifi/mobile network programmatically in my application. Thanks in advance!
推荐答案
有关获取无线网络的速度
For getting wifi speed
WifiManager wifiManager = Context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo != null) {
Integer linkSpeed = wifiInfo.getLinkSpeed(); //measured using WifiInfo.LINK_SPEED_UNITS
}
和移动网络的速度参考以下链接:
And mobile network speed refer the below link:
http://www.gregbugaj.com/?p=47
这篇关于无线/移动网络获取数据的速度编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文