Mobile bluetooth device name

How to get name of the connected Bluetooth device on android

I can get information about the device that is previously paired and trying to make a connection or a device trying to pair to the device. what I want is the name or the connection state of the currently paired and connected device.

2 Answers 2

String name; String address; String threadName; public void checkConnected() < BluetoothAdapter.getDefaultAdapter().getProfileProxy(this, serviceListener, BluetoothProfile.HEADSET); >private BluetoothProfile.ServiceListener serviceListener = new BluetoothProfile.ServiceListener() < @Override public void onServiceDisconnected(int profile) < >@Override public void onServiceConnected(int profile, BluetoothProfile proxy) < for (BluetoothDevice device : proxy.getConnectedDevices()) < name = device.getName(); address = device.getAddress(); threadName = Thread.currentThread().getName(); Toast.makeText(MainActivity.this, name+" " + address+ threadName, Toast.LENGTH_SHORT).show(); txtName.setText(name + " " + address); Log.i("onServiceConnected", "|" + device.getName() + " | " + device.getAddress() + " | " + proxy.getConnectionState(device) + "(connected = " + BluetoothProfile.STATE_CONNECTED + ")"); >BluetoothAdapter.getDefaultAdapter().closeProfileProxy(profile, proxy); > >; 
BluetoothServerSocket bluetoothServerSocket = bluetoothAdapter.listenUsingRfcommWithServiceRecord("abc", uuid); BluetoothSocket bluetoothSocket = bluetoothServerSocket.accept(); BluetoothDevice device = bluetoothSocket.getRemoteDevice(); String deviceName = device.getName(); 

looks like the code stock when it get to this line BluetoothSocket bluetoothSocket = bluetoothServerSocket.accept();

Have you checked the documentation? developer.android.com/guide/topics/connectivity/… Check out the sections «Querying paired devices» and «Discovering devices». Especially the call to device.getName()

Thanks for your reply. But what I want is to get the connection status of the currently paired and connected Bluetooth device . No the ones that are trying to connect. For that situation I preferred to use broadcast Listers

And about the link you mentioned, BluetoothDevice class doesn’t provide a function to make a query of paired devices connection state

Источник

How to Change Device Name on Android (WiFi and Bluetooth)

Your Android device’s name works as a hostname while connecting to other devices via WiFi. A personalized device name for WiFi, Hotspot, or Bluetooth connection makes it easy to recognize a device in the list of other connected devices. By default, all Android devices come with a generic name and so it’s a good idea to give your device a unique name. Here is how to change the device name on Android for wired and wireless connections. Moreover, we’ll also see how we can change the device name in the Google Play Store.

Before you proceed, however, please check out my handy tutorial describing all the possible methods to find the codename of an Android device.

Читайте также:  Загрузить файл через блютуз

Personally, I prefer to see a personalized name for all my devices whether it be my PC, laptop, smartphone, or WiFi router. If you own an Android smartphone or a tablet device, follow the instructions below to change the following:

  • Android device name
  • Bluetooth name
  • WiFi Direct name
  • Mobile hotspot name
  • Device name in the Play Store

Changing the device name automatically changes the names for Bluetooth and WiFi Hotspot connections. However, it’s possible to set one name for your Android device and a different Bluetooth name and hotspot name. Having given a custom name to your device, you can easily recognize your device in the list of available wireless networks and Bluetooth devices. Thankfully, changing the device name is not as complicated as turning off Talkback on Android devices.

Change Device Name on Android

If you want to personalize the device name of your Android phone or tablet, the easiest way is to do it via Settings.

  1. Open the Settings app on your Android device.
  2. Scroll down to About phone or About device and tap on it.about phone xiaomi redmi
  3. Now tap on the Device name option.device name option xiaomi
  4. Type the desired name and select OK.device name change on xiaomi

If you own a Samsung Galaxy phone or Tab, the steps to change the device name are almost the same.

Go to Settings > About phone and tap on the Edit button. Type the device name you want and tap on Done.

change device name in samsung

It doesn’t matter whether you own a device from OnePlus, Realme, Oppo, Vivo, Nokia, Lenovo, Huawei, etc., you just need to navigate to Settings > About phone > Device name, tap on the current device name, and assign a name. Once you change the name using the method given above, it’ll show the custom name for all wired and wireless connections.

wireless device names on samsung tv

Android device names on Samsung TV

connected device windows 10

Android device name on Windows PC

Change Device Name via ADB Command

While changing the Android device name via Settings is very easy, there’s still another way you should try. You must be familiar with ADB commands and you can change your Android phone’s name using ADB as instructed below.

  1. Download the latest Android SDK Platform-tools and set them up on your computer.
  2. Install the latest Android USB driver on your computer.
  3. Open the platform-tools folder and launch the command prompt window. There are 2 ways to do that.
    1. Place the mouse pointer at an empty place in the folder window, right-click on the mouse, and select the Open PowerShell window here option.
    2. Just type “cmd” in the folder window address bar and hit the Enter key.
    adb devices
    adb shell settings get global device_name
    adb shell settings put global device_name "Galaxy Note 10+ Technastic"
  4. The screenshot attached below will help you understand all the steps clearly.change android device name adb shell
  5. Now, navigate to Settings > About phone and you’ll find that the device name has been changed.android device name changed
Читайте также:  Как включить блютуз в фольксваген поло

Here is a huge list of ADB Shell commands that you must check out to learn more.

Changing WiFi Hotspot Name

Usually, I use my Android phone’s hotspot to binge-watch Netflix and Prime Video shows on my Smart TV and surf the web on my laptop during commutes. It’s a good idea to give a device a personalized name for convenience. In case you just want to change the hotspot name of your Android device, below are the steps.

mobile hotspot samsung

  1. Open Settings on your Android phone.
    • Samsung Galaxy devices: Tap on Connections >Mobile Hotspot and Tethering.
    • OnePlus phones: Tap on Mobile/Wi-Fi Hotspot and Tethering.
    • Xiaomi Redmi phones: Tap on Portable Hotspot under SIM cards and mobile networks.
  2. To change the hotspot name on Android devices from different OEMs follow the steps below.
    • Samsung devices: You need to enable the mobile hotspot before you can change its settings. Tap on Mobile Hotspot and Tethering as shown below. Tap on the current device name and rename it. Select the Save option.

change hotspot name xiaomi

Hotspot name on Xiaomi and Redmi

change hotspot name oneplus

Hotspot name on OnePlus phones

Change Bluetooth Name on Android

As I mentioned above, you can set different device names for Bluetooth and WiFi connections while keeping a different device name on Android. Below is how you can change the Bluetooth name for an Android device.

Note: You must turn on Bluetooth on your device before you can edit its settings.

  1. Open the Settings app on your Android device.
  2. Tap on Bluetooth and turn it on. Alternatively, you can open the Quick Settings panel by sliding down the status bar and tapping and holding the Bluetooth icon.bluetooth android xiaomi
  3. Tap on the Device name and type the Bluetooth name for your device.change bluetooth name xiaomi
    • If you own a OnePlus phone, you need to select Pair new device to access the Device name option.change bluetooth name oneplus
    • On Samsung Galaxy devices, you don’t have the option to change the Bluetooth name. Samsung devices automatically take your device name as the Bluetooth name.

Changing Wi-Fi Direct Name

Wi-Fi Direct is a faster way than Bluetooth for sharing files over a wireless network. If you want to set the Wi-Fi Direct name for your device, here’s how to do it.

  1. Turn on the WiFi on your device first.
  2. Open Android Settings on your device and tap on Wi-Fi.
  3. Now do as described below.
  4. Xiaomi phones: Select Additional settings and tap on Wi-Fi Direct. You need to tap on Device name and enter the name you want.

change wifi direct name on oneplus

  • OnePlus devices: Tap Wi-Fi Direct and on the next screen tap the 3-dot icon at the top-right corner. Select Rename device and type the Wi-Fi Direct name for your phone.
  • Samsung devices: On Samsung Galaxy devices, the device name you set will automatically be assigned as the Wi-Fi Direct name for your device.
  • Change Device Name on Google Play Store

    Every Android phone has the Google Play Store apps installed out of the box. All Android devices registered with the same Gmail ID are shown on your Google account dashboard.

    google dashboard android devices

    If you want your Google Play Store and Google Dashboard to show a personalized name for your Android devices, follow the steps given below.

    change device in google play store

    1. Open the Google Play Store settings page on your desktop or mobile browser.
    2. You’ll see the list of your devices.
    3. Tap or click on the Edit button in front of the device name and rename the device.
    4. After that, tap on the Update icon.

    That’s it! You have successfully changed the device name for your Android phone. Next time you try to install an app from the Google Play Store (web), you’ll be asked to choose a device with the name you assigned.

    choose a device in google play store

    It’s time to wind up my tutorial here. I hope now you’ll be able to change not only the device name on your Android but also the Bluetooth name, Hotspot name, and WiFi Direct name. In case you still have any questions, please drop us a comment.

    Источник

    Оцените статью
    Adblock
    detector