Use the class TelephonyManager .
Using getPhoneType () can tell if it's a phone and your type.
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if(telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE){
//não é telefone
}
If it's a phone, you can know the status of the SIM using the method getSimState () .
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
int phoneType = telephonyManager.getPhoneType();
if(phoneType == TelephonyManager.PHONE_TYPE_NONE){
//não é telefone
}else if(phoneType == TelephonyManager.PHONE_TYPE_GSM){
if(telephonyManager.getSimState() == TelephonyManager.SIM_STATE_READY){
//Tem SIM e está pronto a usar
}
}
See the documentation for the possible values returned by getPhoneType () and getSimState () .