欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

android獲取當(dāng)前接入點(diǎn)信息判斷是ctwap還是ctnet實(shí)例代碼

 更新時(shí)間:2013年11月29日 14:47:32   作者:  
這篇文章主要介紹了android獲取當(dāng)前接入點(diǎn)信息判斷是ctwap還是ctnet的方法,大家參考使用吧
復(fù)制代碼 代碼如下:

/**
     * 獲取當(dāng)前的接入點(diǎn)是ctwap還是ctnet
    * @author <a href="mailto:yejiurui@126.com">yejiurui</a>
     * @version 1.0 2013-5-17 下午5:46:05  2013
     */
    private  String CTWAP="ctwap";
    private  String CTNET="ctnet";
    private  Uri PREFERRED_APN_URI = Uri
        .parse("content://telephony/carriers/preferapn");

    public  String getApnType(Context context) {
        String apntype = "nomatch";
        Cursor c = context.getContentResolver().query(PREFERRED_APN_URI, null,
                null, null, null);
        c.moveToFirst();
        String user = c.getString(c.getColumnIndex("apn"));
        if (user.startsWith(CTNET)) {
            apntype = CTNET;
        } else if (user.startsWith(CTWAP)) {
            apntype = CTWAP;
        }
        return apntype;
    }

相關(guān)文章

最新評(píng)論