针对上篇文章有个疑惑

Android 1.5 的APN设定与上网处理 这篇转载文章中提到:

 

获取当前所使用的apn的uri地址为:"content://telephony/carriers/preferapn"

 

可在目前这个项目中,我根据这个地址所查出的APN却总不是不对,不知道是不是跟我测试的手机【XT800,双卡双待】有关,因为其他手机就可以正确的识别。针对这个情况,我只能利用ConnectivityManager这个类来检查当前网络环境。。。

 

ConnectivityManager cwjManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);


NetworkInfo activeNetworkInfo = cwjManager.getActiveNetworkInfo();
 

 

WIFI:
NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true

NET:
NetworkInfo: type: MOBILE[GPRS], state: CONNECTED/CONNECTED, reason: apnSwitched, extra: cmnet:GSM, roaming: false, failover: false, isAvailable: true

WAP:
NetworkInfo: type: MOBILE[GPRS], state: CONNECTED/CONNECTED, reason: apnChanged, extra: cmwap:GSM, roaming: false, failover: false, isAvailable: true

你可能感兴趣的:(android,.net,mobile,WAP)