Change device name programmatically in android

3.9k views Asked by At

I need to change my phone device name not the bluetooth name.

I need to change the one which we get by doing this,

android.os.Build.MODEL;

Current Output: H30-U10

2

There are 2 answers

1
Sunny Garg On

Try to do below -

private BluetoothAdapter bluetoothAdapter = null;
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

void ChangeDeviceName(){
     Log.i(LOG, "localdevicename before: "+bluetoothAdapter.getName(); //before
     bluetoothAdapter.setName("name_what_you_want");
     Log.i(LOG, "localdevicename after: "+bluetoothAdapter.getName(); //after

 }
0
Snehil Wani On

You can access the devices model name manufacturer but you are not supposed to change it.
The only way to do so is "ROOTING" the Device.