hopia hopia - 2 months ago 27
Android Question

How to get Samsung Android Device Name programmatically?

Other similar questions in SO are answered by retrieving the Build.MODEL name.

But what I would really like is to get the customizable Device name on Samsung Devices. I know it is customizable because on my Galaxy Note, I can change it from the settings->About device. For example, below, I would like to retrieve the "Milky Way" string.

enter image description here

Answer

There is no common way getting this, since it's not a "android-feature" more likely a Samsung Feature afaik.

Try getting it with this, which worked on my galaxy s3, s4 and s5

BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();
String deviceName = myDevice.getName();

Do not forget to add the bluetooth permissions.

<uses-permission android:name="android.permission.BLUETOOTH"/>
Comments