What is the purpose behind defining a maximum length for android device's bluetooth name?
I have an android device and I could name the BT with a name of unlimited length > 248 character
Based on that [https://www.bluetooth.com/specifications/bluetooth-core-specification/][1] : maximum standard length = 248 octets means 248 character = 248 UTF-8
What's the aim behind that ?
Defining maximums/minimums in the Bluetooth specification (and any specification for that matter) is mostly to ensure interoperability between different devices that are aiming to use the Bluetooth technology.
Let's say for example that I am an Android app developer and I want to to scan and display Bluetooth device names on the screen. When creating the variable for storing and displaying the returned name, I need to set it to 248 and know that this should be enough for my Android app to work on all Bluetooth devices. However, if the BT device maximum name length wasn't defined by the spec, then I would set the variable to 300 and it still wouldn't work for all devices because someone might choose to create a name that is 1000 bytes long.
Communication specifications/protocols are full of these definitions to ensure compatibility between devices that support the communication technology. For more information on this, I recommend the following links:-