0

I want to get the name of my device (Samsung SM-P900) not the model name.

If i try to get the name with code like this:

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

it gives me a Model name like SM-P900, but it is not that what i want.

Have any idea???

EDIT: Here is wat i want.

iwanlenin
  • 210
  • 4
  • 11

1 Answers1

2

To display the device name/model in android use:

TextView myTv = (TextView) findViewById(R.id.myTv);
String name = android.os.Build.MODEL;
myTv.setText(name);

Please refer to this link as well: Android build class

blueware
  • 5,205
  • 1
  • 40
  • 60
  • Thanks. But its not work for mee. Samsung have a editable Device name (like My Samsung) and i need to get this name not the name of Build.Model. – iwanlenin Jun 16 '15 at 09:50
  • Alright, did you make sure that you added this permission to your manifest: ? – blueware Jun 16 '15 at 09:52
  • Yes. it returns me SM-P900. :-( I want to get that here: https://onedrive.live.com/redir?resid=69c23ff4c5255036!29120&authkey=!ACZzi69LS4gcd8c&v=3&ithint=photo%2cPNG – iwanlenin Jun 16 '15 at 09:56
  • I found this answer here: http://stackoverflow.com/q/7071281/2268466 , it may help you ! – blueware Jun 16 '15 at 10:08
  • 1
    The device name property is not implemented in core Android - it is something that device manufacturers may add on their own. There is no general way to retrieve this property. – Jason Jun 16 '15 at 14:30