Reputation: 1441
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.
Upvotes: 0
Views: 4349
Reputation: 5979
Use this:
TelephonyManager telephone = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String sim_nul = telephone.getSimSerialNumber();
String op_name = telephone.getNetworkOperatorName();
Here you will get Sim number as well as Operator name like Vodafone etc.
Upvotes: 2
Reputation: 132982
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
}
Upvotes: 1
Reputation: 2145
final TelephonyManagertm(TelephonyManager)getBaseContext().getSystemService
(Context.TELEPHONY_SERVICE);
String deviceid = tm.getDeviceId();
String sim_operatorname=tm.getSimOperatorName();
String sim_number=tm.getSimSerialNumber();
String manufacturer_name =Build.MANUFACTURER.toString().trim();
Upvotes: 2