如何在我的Android PROGRAME让我的Android设备的名字吗? [英] How to get my android device name in my android programe?
问题描述
我得到命令行命令亚行deivces设备名称。
现在,我想在我的Android设备名称。
I get device names by the command "adb deivces" in command line. Now I want get name in my android device.
String serial = null;
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
serial = (String) get.invoke(c, "ro.serialno");
System.out.println(serial);
}
catch (Exception ignored) {
}
在我的Android精品那些作品phone.But我的宏基A500平板电脑得到真正的序列号。
这不是我从ADB命令获取名称对应。
those works fine in my android phone.But my acer a500 tablet gets the real serial number. This is not correspond with the name I get from the adb command.
我surpose的DDMS通过其他方法获取设备名称。
但我不知道。
I surpose the ddms gets the devices name by another method. But i dont know.
推荐答案
getting- Android的设备名称
我不希望这个链接可以帮助你。
getting-android-device-name i do hope this link may help you.
TextView的TV1 =(的TextView)findViewById(R.id.tv1);
字符串str = android.os.Build.MODEL;
tv1.setText(STR);
这篇关于如何在我的Android PROGRAME让我的Android设备的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!