Search code examples
androidsim-card

How to identify type of SIM?


I am developing an application where I need to check type SIM based on that I need to perform calls . I am able to get network type but I am not able to get type of SIM he is using.


Solution

  • determine the type of sim card sim / uim / usim:

     / / Get SIMType 
    
      
    
    The string simType = "unknown";
    
    / / Get the system, to obtain the sim data   
    
    TelephonyManager tm = (TelephonyManager) context.getSystemService (Context.TELEPHONY_SERVICE);
    
    / / Get the cell phone SIMType   
    
    int type = tm.getNetworkType ();   
    
    / / Determine the type of value, and named  
    
    if (type == TelephonyManager.NETWORK_TYPE_UMTS) {   
    
    simType = "USIM";
    
    / / Type defined for UMTS USIM card for wcdma   
    
    } Else if (type == TelephonyManager.NETWORK_TYPE_GPRS) {   
    
    simType = "SIM";
    
    / / Type defined for GPRS GPRS SIM card   
    
    } Else if (
    
    type == TelephonyManager.NETWORK_TYPE_EDGE) {   
    
    simType = "SIM";
    
    / / Type defined for EDGE-EDGE SIM card   
    
    } Else {   
    
    simType = "UIM";
    
    / / Type is unknown definition of UIM card for cdma   
    
    }