如何检测Android上的网络连接类型?
是通过ConnectivityManager.getActiveNetworkInfo().getType(),并且答案仅限于Wifi和移动?
我的应用将以直播视频流为特色.我想知道是否有办法检测用户的设备上是否有2G,3G或4G,以及当前连接属于哪个类别?我的问题是关于Android设备.
I'm creating an app that uses Google's Geolocation API, as documented here.
As part of the POST request I need to send to their API, I need to include The mobile radio type, radioType. The question of how to receive that has already been asked and answered here.
My question is as follows:
telephoneManager.getNetworkType()我显然应该使用的函数返回 18 个值之一,在此处记录为常量。
这是否意味着radioTypeGoogle 的地理定位 API 所描述的真的可以是 18 个不同的值?因此,如果事实证明我的无线电类型不是他们支持的四种类型(GSM、LTE、CDMA 或 WCDMA)之一,那么我只是运气不好,将不得不因不包括radioType在我的请求中而损失准确性?
我有一种感觉,我正在混淆这些术语radio type,network …