开发者

different sources for iphone via 3G and WIFI

what is the best way to load a different source fil开发者_开发技巧e over 3G connection than over WIFI?

thanx


Apple's Reachability

Follow the ReadMe and include the necessary frameworks. Then use the code sample below:

NetworkStatus status = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus]; 
if (status == ReachableViaWiFi) { 
        // wifi connection 
if (status == ReachableViaWWAN) { 
        // wwan connection (could be GPRS, 2G or 3G) 
} else { 
        // no network 
}

If you are designing a web application, the connection type cannot be determined.


If you by resources mean video or audio streams then consider providing HTTP streaming resources from your server. This way the frameworks will choose what is best for the current connection, and even update the source if the connection status changes.

Read more here: https://developer.apple.com/streaming/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜