公告
财富商城
积分规则
提问
发文
2020-01-29 18:23发布
姐就是有狂的资本
I know this question is something that is often asked but no matter what I tried I couldn't find the answer.
I use an AVD android TV (API 24) and want to access this :
How can I access this name in my app ? Even with adb I never found it...
this is worked for my AVD (API level 24).
String deviceName = Settings.Global.getString(getContentResolver(), "device_name");
Instead of the string "device_name", you can also use the constant Settings.Global.DEVICE_NAME.
Settings.Global.DEVICE_NAME
This property was moved into Settings.Global in API 17.
Settings.Global
Before API 17, the following code should work:
String deviceName = Settings.System.getString(getContentResolver(), "device_name");
最多设置5个标签!
this is worked for my AVD (API level 24).
Instead of the string "device_name", you can also use the constant
Settings.Global.DEVICE_NAME
.This property was moved into
Settings.Global
in API 17.Before API 17, the following code should work: