Yes, I know the library, but in my Samsung Galaxy S4 (Android 4.3) in Settings - More - About device, you can enter a device name as shown in the picture above.
I have also observed that this field is not available on Android 2.x devices you
Is it possible that this field is only available in certain versions of Android such as 4.3 and 4.2?
As far as I know, device name which appears in latest versions of the os, is not the same with the bluetooth device name ( and/or the wifi-direct one). If you want to get the bluetooth friendly name, if this is not supported by the serial lib, you could do it by using the reflection lib.
Changing the device name or any other non-standard features are added by the manufacturer, Samsung does it, HTC does it, etc, so, there's no way to use it all the time since it's manufacturer specific.
The Name of the device can be changed in system-settings... In ABOUT PHONE i found Devicename which is editable at this place... That´s the name of the device when i connect it via usb to pc and i think its also the name when using wifi but i´m not sure!