如何在我的Andr​​oid PROGRAME让我的Andr​​oid设备的名字吗? [英] How to get my android device name in my android programe?

查看:157
本文介绍了如何在我的Andr​​oid PROGRAME让我的Andr​​oid设备的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到命令行命令亚行deivces设备名称。
现在,我想在我的Andr​​oid设备名称。

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) {  

    }

在我的Andr​​oid精品那些作品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);

这篇关于如何在我的Andr​​oid PROGRAME让我的Andr​​oid设备的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆