1.获取手机的电话号码:
TelephonyManager tm=(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
2.获取运营商的编码信息
/IMSI国际移动用户识别码 * http://baike.baidu.com/view/715091.htm
*/
public String getProvidersName() { String ProvidersName = null; String IMSI = tm.getSubscriberId(); // if ( IMSI.startsWith("46000") || IMSI.startsWith("46002") || IMSI.startsWith("46007") ) { ProvidersName = "中国移动"; } else if ( IMSI.startsWith("46001") ) { ProvidersName = "中国联通"; } else if ( IMSI.startsWith("46003") ) { ProvidersName = "中国电信"; } return ProvidersName; }