device-name

To discover and pair Bluetooth Devices

不羁岁月 提交于 2019-12-30 13:46:48
问题 How to discover and pair Android Bluetooth devices using Java? Any codes for me to refer to? 回答1: the following code will discover the list of paired and the unpaired devices after that u have to implement the Client and server, which takes care of pairing the devices and sending data to the devices, for tat u can make use of the BluetoothChatSample which will give an idea to u. private Set<BluetoothDevice> pairedDevices; public static ArrayList<Object> BondedDeviceList; public static

How to get the deviceName of my device using wifi p2p

只谈情不闲聊 提交于 2019-12-25 06:44:57
问题 I'm developing an app based on Google's wifi p2p API and I would like to get the name of the device I'm using (not the peers) but the only way I found to retrieve the name is in case I change it by using something like this: if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)) { // this device details has changed(name, connected, etc) mApp.mThisDevice = (WifiP2pDevice) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE); mApp.mDeviceName = mApp.mThisDevice

Get Android Device Name [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-17 03:50:44
问题 This question already has answers here : Get Android Phone Model programmatically (15 answers) Closed 11 months ago . How to get Android device name? I am using HTC desire. When I connected it via HTC Sync the software is displaying the Name 'HTC Smith' . I would like to fetch this name via code. How is this possible in Android? 回答1: In order to get Android device name you have to add only a single line of code: android.os.Build.MODEL; Found here: getting-android-device-name 回答2: You can see

Android: How to get current device WiFi-direct name

社会主义新天地 提交于 2019-12-12 07:17:32
问题 In a P2P setting, I understand how to get another device's name, but how do I get my own device's name? (the one displayed in WiFi-direct under settings). I have checked WiFiManager , WiFiInfo , and more with no success. 回答1: After you turn on wifi on your device, it is send a WIFI_P2P_THIS_DEVICE_CHANGED_ACTION broadcast. You can catch this with a broadcast receiver and you can get a WifiP2pDevice object, that is your device. @Override public void onReceive(Context context, Intent intent) {

How change the device name in WiFi direct p2p?

▼魔方 西西 提交于 2019-12-04 00:48:34
问题 Is it possibile to change the device name of WiFi direct through the code? I've tried to: private WifiP2pDevice wDevice; wDevice.deviceName = "newName"; But, obviously it doesn't work. Any idea?! 回答1: Following code use Reflection api of Java,It is less preferrable due to lack of efficiency but Android does not provide another way so, You can use it works with charm : try { Method m = wpm.getClass().getMethod( "setDeviceName", new Class[] { WifiP2pManager.Channel.class, String.class,

To discover and pair Bluetooth Devices

柔情痞子 提交于 2019-12-01 12:53:12
How to discover and pair Android Bluetooth devices using Java? Any codes for me to refer to? the following code will discover the list of paired and the unpaired devices after that u have to implement the Client and server, which takes care of pairing the devices and sending data to the devices, for tat u can make use of the BluetoothChatSample which will give an idea to u. private Set<BluetoothDevice> pairedDevices; public static ArrayList<Object> BondedDeviceList; public static ArrayList<Object> NewDeviceList; public void makeDiscoverable() { discoverableIntent = new Intent(BluetoothAdapter

Display Android Bluetooth Device Name

怎甘沉沦 提交于 2019-12-01 04:03:04
问题 How to display a bluetooth device name in android which uses Java? Any codes for me to refer to? 回答1: The below code will get u the bluetooth name, here mBluetoothAdapter is of type BluetoothAdapter . public String getLocalBluetoothName(){ if(mBluetoothAdapter == null){ mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); } String name = mBluetoothAdapter.getName(); if(name == null){ System.out.println("Name is null!"); name = mBluetoothAdapter.getAddress(); } return name; } 来源: https:/

How change the device name in WiFi direct p2p?

六月ゝ 毕业季﹏ 提交于 2019-12-01 03:27:38
Is it possibile to change the device name of WiFi direct through the code? I've tried to: private WifiP2pDevice wDevice; wDevice.deviceName = "newName"; But, obviously it doesn't work. Any idea?! user3409573 Following code use Reflection api of Java,It is less preferrable due to lack of efficiency but Android does not provide another way so, You can use it works with charm : try { Method m = wpm.getClass().getMethod( "setDeviceName", new Class[] { WifiP2pManager.Channel.class, String.class, WifiP2pManager.ActionListener.class }); m.invoke(WifiP2pManager wifimngr,WifiP2pManager.Channel

Android : Get “device name” on android tv

心已入冬 提交于 2019-11-26 22:26:47
问题 I know this question is something that is often asked but no matter what I tried I couldn't find the answer. I use an AVD android TV (API 24) and want to access this : How can I access this name in my app ? Even with adb I never found it... 回答1: this is worked for my AVD (API level 24). String deviceName = Settings.Global.getString(getContentResolver(), "device_name"); Instead of the string "device_name", you can also use the constant Settings.Global.DEVICE_NAME. This property was moved into

Get Android Device Name [duplicate]

北城以北 提交于 2019-11-26 17:10:32
This question already has an answer here: Get Android Phone Model programmatically 14 answers How to get Android device name? I am using HTC desire. When I connected it via HTC Sync the software is displaying the Name 'HTC Smith' . I would like to fetch this name via code. How is this possible in Android? hbhakhra In order to get Android device name you have to add only a single line of code: android.os.Build.MODEL; Found here: getting-android-device-name You can see answers at here Get Android Phone Model Programmatically public String getDeviceName() { String manufacturer = Build