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

倖福魔咒の 提交于 2019-12-19 05:18:54

问题


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?


回答1:


This is totally possible in iOS7. Please check this answer

Hope this helps




回答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 :)




回答3:


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)



来源:https://stackoverflow.com/questions/8122170/how-do-i-know-whether-my-iphone-ipad-is-connected-to-2g-or-3g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!