Android 获取手机串号
Context context = getWindow().getContext();
TelephonyManager telephonemanage = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
Toast.makeText(this, "MIEI码为:"+telephonemanage.getDeviceId(), 1000).show();
}
catch(Exception e) {
Log.i("error", e.getMessage());
}
而且需要在AndroidManifest.xml 加入权限才行,内容为:
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>