知乎:https://www.zhihu.com/people/monkey.d.luffy Android高级开发交流群2: 752871516
全部博文(315)
分类: 嵌入式
2015-08-12 11:10:06
原文地址:Android获取手机的型号和系统版本 作者:liubird
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- TextView textView = (TextView) findViewById(R.id.text);
- textView.setText("Product Model: " + android.os.Build.MODEL + ","
- + android.os.Build.VERSION.SDK + ","
- + android.os.Build.VERSION.RELEASE);
- }
注:android.os.Build.VERSION.RELEASE获取版本号
android.os.Build.MODEL 获取手机型号