【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:armink.ztl@gmail.com】
近日在修改Android 的Launcher时,找到获取Android设备信息的方法,和大家分享一下。
String phoneInfo = "Product: " + android.os.Build.PRODUCT;
phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI;
phoneInfo += ", TAGS: " + android.os.Build.TAGS;
phoneInfo += ", VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE;
phoneInfo += ", MODEL: " + android.os.Build.MODEL;
phoneInfo += ", SDK: " + android.os.Build.VERSION.SDK;
phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;
phoneInfo += ", DEVICE: " + android.os.Build.DEVICE;
phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY;
phoneInfo += ", BRAND: " + android.os.Build.BRAND;
phoneInfo += ", BOARD: " + android.os.Build.BOARD;
phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT;
phoneInfo += ", ID: " + android.os.Build.ID;
phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER;
phoneInfo += ", USER: " + android.os.Build.USER;
// Toast.makeText(this, phoneInfo, Toast.LENGTH_LONG).show();
System.out.println(phoneInfo);
TextView t = (TextView) findViewById(R.id.main_phoneinfo);
t.setText(phoneInfo);
得到信息如下:
Product: sec_smdk6410,
CPU_ABI: armeabi,
TAGS: test-keys,
VERSION_CODES.BASE: 1,
MODEL: smdk6410,
SDK: 7,
VERSION.RELEASE: 2.1,
DEVICE: smdk6410,
DISPLAY: sec_smdk6410-eng 2.1 ERD79 eng.tangk.20130821.003924 test-keys,
BRAND: sec,
BOARD: unknown,
FINGERPRINT: sec/sec_smdk6410/smdk6410/:2.1/ERD79/eng.tangk.20130821.003924:eng/test-keys,
ID: ERD79,
MANUFACTURER: Samsung,
USER: tangk
我的设备是定制的,所以上面很多信息和手机上不太相同