Android : Get "device name" on android tv

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 :

enter image description here

How can I access this name in my app ? Even with adb I never found it…

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

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.


This property was moved into Settings.Global in API 17.

Before API 17, the following code should work:

String deviceName = Settings.System.getString(getContentResolver(), "device_name");

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply