获取手机相关信息和SIM卡信息
具体的信息看名字应该可以猜个差不多,还有很多没有写出来的,以后遇到了会慢慢添加...
public void fetch_status(){
TelephonyManager tm = (TelephonyManager) this
.getSystemService(Context.TELEPHONY_SERVICE);//
String str = "";
str += "DeviceId(IMEI) = " + tm.getDeviceId() + "/n";
str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "/n";
str += "Line1Number = " + tm.getLine1Number() + "/n";
str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "/n";
str += "NetworkOperator = " + tm.getNetworkOperator() + "/n";
str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "/n";
str += "NetworkType = " + tm.getNetworkType() + "/n";
str += "honeType = " + tm.getPhoneType() + "/n";
str += "SimCountryIso = " + tm.getSimCountryIso() + "/n";
str += "SimOperator = " + tm.getSimOperator() + "/n";
str += "SimOperatorName = " + tm.getSimOperatorName() + "/n";
str += "SimSerialNumber = " + tm.getSimSerialNumber() + "/n";
str += "SimState = " + tm.getSimState() + "/n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "/n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "/n";
}
//获取手机当前系统的信息
public void getLocalMsg(){
Locale.getDefault().getLanguage();//获取手机的当前系统语言
Locale.getDefault().getCountry();//获取国家代号
}
//獲取手機信息
private void getPhoneInfo(){
String language = getResources().getConfiguration().locale.getCountry();
DisplayMetrics dm = getResources() .getDisplayMetrics();
int w = dm.widthPixels;
int h = dm.heightPixels;
String screen_size = w+"*"+h;
String device = Build.MODEL;//手机型号
String osver = android.os.Build.VERSION.SDK;//手机SDK版本 - level - 4
String relea = android.os.Build.VERSION.RELEASE;//手机SDK版本 1.6
TelephonyManager telephonyManager=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = telephonyManager.getDeviceId();//手机IMEI
String mobileno = telephonyManager.getLine1Number();//手机号码
}
Android 2.0 平台,可以用IGoogleLoginService.getAccounts()的得到gmail 帐号,也能用IGoogleLoginService.saveUsernameAndPassword() 把一个已知的gmail帐号和密码设进去。