Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the user defined "Device Name" in android?

Tags:

java

android

I am trying to get the user defined device name that is set in settings. I've tried several options and so far nothing.

If it helps or hurts I am needing it in a BroadcastReceiver

Thanks

like image 634
Chris Whittle Avatar asked May 23 '13 02:05

Chris Whittle


People also ask

How do I find my Android device name?

Open the Settings app to check your device information: Tap About phone. Take note of your device name.

How do I find device info programmatically?

In Android one can easily fetch the information programmatically using Build class. Build class in android provides the basic information like serial number, android SDK, brand, model no, manufacture, version code and etc.


1 Answers

This got me what I was needed... http://cmanios.wordpress.com/2012/05/09/bluetooth-adapter-device-name-and-mac-address-in-android/

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

Make sure you add

<uses-permission android:name="android.permission.BLUETOOTH"/> 

to your manifest

like image 112
Chris Whittle Avatar answered Oct 08 '22 09:10

Chris Whittle