From Android 4.2 onwards, user can change the Device name in settings menu. Is there any API exposed to retrieve that value from code??
Asked
Active
Viewed 682 times
0
-
maybe this helps http://stackoverflow.com/questions/6662216/display-android-bluetooth-device-name – A.S. Dec 19 '13 at 09:50
3 Answers
1
Yes you can, use this:
android.os.Build.MODEL
to get the model,and this to get the manufacturer:
android.os.Build.MANUFACTURER
UPDATE: As been said here, No all device will have this option. You can try getting it this way:
BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();
String deviceName = myDevice.getName();
add a perrmision to the manifest file as well:
<uses-permission android:name="android.permission.BLUETOOTH"/>
reference: How do you get the user defined "Device Name" in android?
But this wont always work.
-
No..I need Device name set by user. MODEL and MANUFACTURER is different. – Tapas Jena Dec 19 '13 at 09:55
0
To display the device name/model in android use:
TextView tv1 = (TextView) findViewById(R.id.tv1);
String str = android.os.Build.MODEL;
tv1.setText(str);

VenuNalla
- 39
- 8
0
I dont think you can rely on this functionality as it may be a Samsung modification.
My Nexus 5 does not have the ability to change the device name on this settings page on Android 4.4

Kuffs
- 35,581
- 10
- 79
- 92