Copy Code code as follows:
Get the phone's IMSI code
Telephonymanager Telmanager = (telephonymanager) getsystemservice (Telephony_service);
String Sendnum=null;
String Imsi=telmanager.getsubscriberid ();;
if (IMSI!= null) {
if (Imsi.startswith ("46000") | | | imsi.startswith ("46002")) {
Because the IMSI of mobile network number 46000 has been used up, so virtual a 46002 number, 134/159th segment Use this number
Toast.maketext (Getapplicationcontext (), "Current mobile number Sent", 0). Show ();
SENDNUM=CONSTANTS.SENDNUMBER_GD;
else if (Imsi.startswith ("46001")) {//China Unicom
Toast.maketext (Getapplicationcontext (), "current Unicom number sent out", 0). Show ();
SENDNUM=CONSTANTS.SENDNUMBER_GD;
else if (Imsi.startswith ("46003")) {//China Telecom
Toast.maketext (Getapplicationcontext (), "Current telecommunications number sent out", 0). Show ();
SENDNUM=CONSTANTS.SENDNUMBER_JT;
}
}else{
sendnum=constants.sendnumber_jt;//Group number
}