public class Phonesimcinfo {
/** Phone Management Tool class */
Private Telephonymanager Telephonymanager;
/** International Mobile User ID * * *
Private String Mimsi;
Public Phonesimcinfo (Context context) {
Telephonymanager = (Telephonymanager) context.getsystemservice (Context.telephony_service);
}
/** Get phone number: Some phone numbers are not available because the operator does not write the phone number in the SIM */
Public String Getnativephonenumber () {
return Telephonymanager.getline1number ();
}
/** get the company information of mobile phone number * *
Public String Getprovidercompanyname () {
String mname = null;
/** obtaining the International Mobile Subscriber Identification Number (IMSI) */
Mimsi = Telephonymanager.getsubscriberid ();
Try
{
Mimsi = Telephonymanager.getsubscriberid ();
if (Mimsi.startswith ("46000")) {
Mname = "China Mobile";
}else if (Mimsi.startswith ("46002")) {
Mname = "China Mobile";
}else if (Mimsi.startswith ("46001")) {
Mname = "China Unicom";
}else if (Mimsi.startswith ("46003"))
Mname = "China Telecom";
}
catch (Exception Exception)
{
Exception.printstacktrace ();
}
return mname;
}
}
-----------Other relevant information is available------------------------------
Telephonymanager Telephonymanager = (telephonymanager) getsystemservice (Context.telephony_service);
/**mobile phone serial number: The IMEI of GSM handset and the meid.*/of CDMA handset
String DeviceID =telephonymanager.getdeviceid ();
/**get the serial number of your phone's SIM card * /
String IMEI =telephonymanager.getsimserialnumber ();
/**Phone orientation * /
Celllocation str =telephonymanager.getcelllocation ();
/**gets the label associated with the voice mail, which is the identifier */
String voicemail =telephonymanager.getvoicemailalphatag ();
/**Get voice mail number * /
String voicemailnumber =telephonymanager.getvoicemailnumber ();
/**Obtain the ISO country code equivalent to the country code that provides the SIM card * /
String Simcountryiso =telephonymanager.getsimcountryiso ();
Android Get mobile phone number and operator