Android获取手机和系统版本等信息的代码

有时候需要统计手机的型号和版本号,利用程序可以获取到相应的手机信息,对比两部手机发现,厂商不同,某个信息显示方式也不尽相同,具体见:

 1 String phoneInfo = "Product: " + android.os.Build.PRODUCT;
 2         phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI;
 3         phoneInfo += ", TAGS: " + android.os.Build.TAGS;
 4         phoneInfo += ", VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE;
 5         phoneInfo += ", MODEL: " + android.os.Build.MODEL;
 6         phoneInfo += ", SDK: " + android.os.Build.VERSION.SDK;
 7         phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;
 8         phoneInfo += ", DEVICE: " + android.os.Build.DEVICE;
 9         phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY;
10         phoneInfo += ", BRAND: " + android.os.Build.BRAND;
11         phoneInfo += ", BOARD: " + android.os.Build.BOARD;
12         phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT;
13         phoneInfo += ", ID: " + android.os.Build.ID;
14         phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER;
15         phoneInfo += ", USER: " + android.os.Build.USER;
16         // Toast.makeText(this, phoneInfo, Toast.LENGTH_LONG).show();
17         TextView t = (TextView) findViewById(R.id.main_phoneinfo);
18         t.setText(phoneInfo);

参考:http://www.cnblogs.com/hope250/archive/2011/04/04/2005409.html

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。