0

what is the best way to load a different source file over 3G connection than over WIFI?

thanx

reco
  • 459
  • 1
  • 6
  • 13

2 Answers2

0

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.

Evan Mulawski
  • 54,662
  • 15
  • 117
  • 144
  • i guess the apple reachability is limited to native os and not the browsers right? i need to detect this in mobile safari with javascript – reco Jun 12 '11 at 20:37
0

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/

Cœur
  • 37,241
  • 25
  • 195
  • 267
PeyloW
  • 36,742
  • 12
  • 80
  • 99