问题
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....
Please also provide some information about how to check the current speed of that particular connection.
Thanks in advance
回答1:
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
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.
来源:https://stackoverflow.com/questions/3853492/how-to-identify-internet-connection-type-and-its-current-speed