Android的版本信息可以通过android.os.Build获得,电话信息可以通过TelephonyManager获得,代码如下:
private void get_infor(){
sdk = android.os.Build.VERSION.SDK;;
release = android.os.Build.VERSION.RELEASE;
user = android.os.Build.USER;
TelephonyManager tm = (TelephonyManager)
this.getSystemService(Context.TELEPHONY_SERVICE);
deviceid = tm.getDeviceId();
tel = tm.getLine1Number();
imei =tm.getSimSerialNumber();
imsi =tm.getSubscriberId();
}
sdk = android.os.Build.VERSION.SDK;;
release = android.os.Build.VERSION.RELEASE;
user = android.os.Build.USER;
TelephonyManager tm = (TelephonyManager)
this.getSystemService(Context.TELEPHONY_SERVICE);
deviceid = tm.getDeviceId();
tel = tm.getLine1Number();
imei =tm.getSimSerialNumber();
imsi =tm.getSubscriberId();
}
android.os.Build.VERSION.RELEASE是Android版本,android.os.Build.VERSION.SDK是SDK版本,android.os.Build.USER是用户名(不大清楚这里的用户是什么意思)。getDeviceId()是手机的设备ID,getLine1Number()是手机的号码(一般不能获得),getSimSerialNumber()是手机的IMEI,getSubscriberId()是手机的IMSI。
运行效果如下: