How do I know whether my iPhone/iPad is connected to 2G or 3G? [duplicate]
Asked Answered
P

3

12

I was trying to check wether the device is connected via 2G (GPRS, EDGE) or 3G (UMTS, HSDPA).

I only found the Reachability example class from here (Apple Dev Example)

This example only check wether its Wifi or WWAN. I wanna use it to decide wether I download the small data or the huge files. As it is big different between GRPS and UMTS.

Is it possible to distinguish 2G and 3G?

Polygynist answered 14/11, 2011 at 13:18 Comment(7)
What's the reason for checking? It's not the best indicator of network speed.Philps
I have different pictures sizes. In wifi I wanna use the best quality picture, on 3G the normal size picture and on the 2G the bad quality/small picture.Polygynist
Once you detect it's not WiFi, you're probably better off making it download a 1KB test file, then have it time that download and select the appropriate size image based on the transfer speed.Philps
maybe download a sample file of a given size and based on the time that takes determine which version you want to provide. But generally I agree: the thinking should probably be: its either Wifi or or it's slowKantos
I think sometimes the 3G is fast enough to download a picture which is around 1 MB (in an acceptable duration). The 2G network would be too slow and the user would wait impatiently. The trick with the 1KB would only work one time. With this, there is no delegate to check wether 2G changed to 3G network.Polygynist
There are some better ways than downloading a file to determine the speed. Search for 'bandwidth estimation', and you'll find some papers and tools. They need a server component though, which might be a problem. Another direction would be to look at the cell-id. If you can determine it, there might be a way to tell 2g from 3g cells.Verruca
You should see: [#9561753. Not the best answer but should work. [1]: #9561753Mastership
I
1

This is totally possible in iOS7. Please check this answer

Hope this helps

Interlocutor answered 8/2, 2014 at 12:45 Comment(0)
A
2

Since you can not get this information the official way, how about taking a screenshot and make some parser / image processing for the status bar network connectivity icon. Ugly, but would work. And would be fun :)

Appropriate answered 23/5, 2012 at 4:4 Comment(2)
I think this is really a bad way. If apple changes the icon in the next iOS then this method won't work any more. It is definitely the wrong way.Polygynist
There's no wrong way, there's only easy and hard ways :) Apple can always change things, deprecate essential functions without even telling about it, as they have done before - so that's not really a point here ;)Appropriate
O
1

I think the best option is to "rethink" your process:

  • There are no official API to determine whether the user is 2G or 3G

  • 3G is technically faster than 2G but in the practice there are a lot of cases where 3G is very, very slow (bad coverage, too much traffic, etc.)

I'm an heavy mobile internet user and it can happen I have a better 2G than 3G. Take also into account 3G is fast in good conditions but it's not really designed to support high volumes of data (at operator side, and at device's battery side)...

That's why you should take the decision to download small or big file based on WiFi / non-WiFi.

Nevertheless, for the "small file", do not make it "too small", most people that will use your app on WWAN will probably have correct coverage.

(Based on my experience with quite good audience apps in France and Belgium)

Orthoepy answered 14/11, 2011 at 13:18 Comment(0)
I
1

This is totally possible in iOS7. Please check this answer

Hope this helps

Interlocutor answered 8/2, 2014 at 12:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.