1

I have been searching for code through which I can fetch Device's name defined by user for his own device . Have gone through various stackoverflow questions , but none seems to work for me ?

Image as seen in below : Will require Thanks Thanks (SM-T211 ) from android code

enter image description here

10
  • which one ?? can you elaborate by example ?? Commented Jul 15, 2016 at 10:30
  • where does the user define device name? Commented Jul 15, 2016 at 10:36
  • AFAIK i dont see any user editable control in settings > about. can you provide a screenshot? Commented Jul 15, 2016 at 10:41
  • 1
    AFAIK thats device / manufacturer specific. I dont have that feature in my device (Asus Zenfone 2) Commented Jul 15, 2016 at 10:54
  • 1
    Possible duplicate of How do you get the user defined "Device Name" in android? Commented May 10, 2019 at 3:02

3 Answers 3

1

Try this:

String ownerInfo = Settings.Secure.getString(getContentResolver(), "lock_screen_owner_info"); 

As of Android 4.4.2 the owner info value is moved to lock screen database,/data/system/locksettings.db to which 3rd-party apps have no read/write access. That's, there is no reliable way of reading owner info for later Android versions except for rooted device.

Sign up to request clarification or add additional context in comments.

1 Comment

FYI, you can find a more detailed answer listing all the options here: medium.com/@pribble88/…
1

You need to get build.prop file of system which is possible either if your device is rooted or if your has system privileges.... heres the code you may follow to get and edit build.prop Check this App in Play Store. build.prop Editor. Since it's open source, and the code is extremely simple, you can use it as a stating point: https://github.com/nathanpc/Build.prop-Editor

Comments

0

Try this :

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

Make sure you add to your manifest:

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

3 Comments

I know this ... this one gives only model name
I need to know the user defined name as seen in About Device
So , from below answers I assume that to get answer , I will have to root the device , else I wont be able to retrieve Device name from my own device .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.