问题
I would like to find whether the given running device is Galaxy Note programmatically. How can I do this, kindly help me with a snippet to find it.
回答1:
In order to get android device name you have to add only a single line of code:
android.os.Build.MODEL;
Copy and paste the following code in your projects onCreate():
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1 = (TextView) findViewById(R.id.tv1);
String str = android.os.Build.MODEL;
tv1.setText(str);
回答2:
android.os.Build.MODEL;
String deviceModel = android.os.Build.MODEL;
来源:https://stackoverflow.com/questions/12311319/how-to-find-the-device-is-galaxy-note-programmatically