本文介绍了如何找到设备是Galaxy Note的编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想找个给定的运行设备是的的Galaxy Note 的编程。我该怎么做,请帮我一个片段找到它。
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.
推荐答案
为了让Android设备名称必须添加仅code一行:
In order to get android device name you have to add only a single line of code:
android.os.Build.MODEL;
复制并粘贴到你的项目下列code的onCreate():
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);
这篇关于如何找到设备是Galaxy Note的编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!