zoukankan      html  css  js  c++  java
  • android 判断是否有sim卡及运营商

    个人网站http://www.ravedonut.com/ 

    判断是否有sim卡的方法:

    int absent = TelephonyManager.SIM_STATE_ABSENT;    
            if (1 == absent)   
            {  
             Log.d(TAG,"请确认sim卡是否插入或者sim卡暂时不可用!");  
            }  
            


    判断是哪个运营商的

      TelephonyManager telManager = (TelephonyManager) getSystemService(Activity.TELEPHONY_SERVICE);   
            String operator = telManager.getSimOperator();   
            Log.d(TAG,"operator:"+operator);
            if(operator!=null)
            {   
             if(operator.equals("46000") || operator.equals("46002"))
             {   
              Log.d(TAG,"中国移动");
             }else if(operator.equals("46001")){   
              Log.d(TAG,"中国联通");
             }else if(operator.equals("46003")){   
              Log.d(TAG,"中国电信");
             }   
            }   


      

     

  • 相关阅读:
    测光
    闪光灯
    快门
    光圈
    白加黑减
    曝光补偿
    取景雷区
    着眼点
    Web中的无状态含义
    图计算模型[转]
  • 原文地址:https://www.cnblogs.com/panjiangfy/p/androidsim.html
Copyright © 2011-2022 走看看