Android获取手机的型号和系统版本

  1. public void onCreate(Bundle savedInstanceState) {
  2.     super.onCreate(savedInstanceState);
  3.     setContentView(R.layout.main);
  4.     TextView textView = (TextView) findViewById(R.id.text);
  5.     textView.setText("Product Model: " + android.os.Build.MODEL + ","
  6.                 + android.os.Build.VERSION.SDK + ","
  7.                 + android.os.Build.VERSION.RELEASE);
  8. }

注:android.os.Build.VERSION.RELEASE获取版本号

        android.os.Build.MODEL 获取手机型号


你可能感兴趣的:(android)