如何识别互联网连接类型,它的当前速度 [英] How to identify internet connection type and it's current speed
问题描述
您好,我正在使用我的设备测试我的各种类型的互联网连接的应用程序。我希望我的应用程序只有在WI-FI可用,而不是像GPS,WAP,3G等其他情况下发送互联网请求。
Hi I am testing my application for various types of internet connections with my device. I want my application send an internet request only if WI-FI is available and not in other cases like GPS ,WAP, 3G, etc....
提前感谢
推荐答案
使用Apple的Reachability类检查Wifi或WAN。使用此示例和代码: http://developer.apple.com/ library / ios /#samplecode / Reachibility / index.html
Use Apple's Reachability class to check for Wifi or WAN. Use this example and code: http://developer.apple.com/library/ios/#samplecode/Reachability/index.html
检查速度比较困难,你需要自己测量它,也许最好的方法是ping和测量响应延迟。
Checking the speed is more difficult, you would need to measure it by your own I think, maybe the best way is to ping and measure the response latency.
这篇关于如何识别互联网连接类型,它的当前速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!