I want to retrieve the Device Name field that the user can set in the System..About Phone
section of the settings. How can I do this?
This is a field that the user can type any name into e.g. "Richard's Pixel".
This is not the same as the device model name as stored in android.os.Build.MODEL
and related fields.
These are not duplicates of this question as they relate to the device model name:
- How can I get the device name in Android?
- Android: Get the device name programmatically
- Get Android Device Name
This is not a duplicate as it relates to WIFI name:
This is not a duplicate as 1) some solutions return null
, and 2) some solutions return the Bluetooth name configured in a different part of the settings (i.e. this is a different name):
The solutions that return null
could just be out of date.
This link is updated and uses similar code, but it works on Android P. This is a duplicate of that post: