android-bluetooth

How to pair Bluetooth device programmatically Android

故事扮演 提交于 2019-12-17 05:42:08
问题 I am developing an application where I want to connect a Bluetooth device main issue is I don't want user to enter required pin instead application should do that by himself...I don't have any connection related issue...Only want to insert and complete pin authentication process by application itself. I found following code I am sure it is working but not sure on how to add pin in this code?? private void pairDevice(BluetoothDevice device) { try { Log.d("pairDevice()", "Start Pairing...");

How to pair Bluetooth device programmatically Android

≯℡__Kan透↙ 提交于 2019-12-17 05:42:06
问题 I am developing an application where I want to connect a Bluetooth device main issue is I don't want user to enter required pin instead application should do that by himself...I don't have any connection related issue...Only want to insert and complete pin authentication process by application itself. I found following code I am sure it is working but not sure on how to add pin in this code?? private void pairDevice(BluetoothDevice device) { try { Log.d("pairDevice()", "Start Pairing...");

Android 4.3 Bluetooth Low Energy unstable

↘锁芯ラ 提交于 2019-12-17 02:28:27
问题 I am currently developing an application that will use Bluetooth Low Energy (testing on the Nexus 4). After getting started with the official BLE APIs in Android 4.3, I have noticed that after I connect a device for the first time I am rarely able to successfully connect to / communicate with that device or any other device again. Following the guide here, I can successfully connect to a device, scan services and characteristics, and read/write/receive notifications without any issues.

What happens to connection with BLE device when Android goes in sleep mode

时光毁灭记忆、已成空白 提交于 2019-12-13 15:11:39
问题 What happens to connection with BLE device connection when Android goes in sleep mode? So if application establishes a connection with BLE device and then Android goes sleep, will the connection be maintained? Will the application be informed about disconnects or re-connection? 回答1: BLE is devided in two parts, physical layer and link layer implemented in the BLE controller (frontend) upper layers implemented on host side (Android system) both parts connect via the HCI interface. (Which you

Android Bluetooth: fetchUuidsWithSdp() does not return all UUIDs on some devices

萝らか妹 提交于 2019-12-13 12:36:48
问题 I have two different bluetooth apps. The first provides a service and listens to commands from the other commander app. I have a GT-I9100T phone and a GT-P5210 tablet. The tablet when acting at the listener works fine and the phone can see the UUID for my app. But when I run the phone as the listener, the UUID of the listener is not listed. I filter the devices by my application UUID so that I know I am talking only to those devices with my application running. My listening app looks like

java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission

a 夏天 提交于 2019-12-13 11:57:00
问题 Has anyone meet the same problem as the following error message shows when calling bluetoothDeive.createBond() method with android 4.4 api? java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission Note: BLUETOOTH_ADMIN permission is already included in AndroidManifest file. 回答1: You can't use this permission if your app is a third party app (non-system app). To learn more, see Android API: BLUETOOTH_PRIVILEGED 回答2: Got the exact error message. Took me an hour to realize that the

Send image file between Android and iPhone by bluetooth

时间秒杀一切 提交于 2019-12-13 09:45:40
问题 I need a your help I'm making a file transfer app By Bluetooth and Wifi But i can't find how send files from Android to iPhone by bluetooth 1 ) How send files from Android to iPhone ?? 2 ) Where is sample codes ? 回答1: On iOS there are currently two ways to send/receive files over Bluetooth. The first way is over Bluetooth Classic which uses the External Accessory Framework. This does however require that the device you are connected to is MFi enabled, which (to the best of my knowledge) no

JSONString won't convert to JSONArray

孤者浪人 提交于 2019-12-13 06:05:40
问题 I am attempting to send a string json of teams through Bluetooth to another android device. For some reason the Serializer will load a small list of teams but a large list of teams causes this error: 01-21 13:21:30.584 9596-9596/org.huntingtonrobotics.frcrecyclerushpitscouter D/FRCRecycleRushPitScouterJSONSerializer﹕ Error: org.json.JSONException: Unterminated string at character 990 of [{"teleStackDirection":0,"teleCoopSet":0,"autoTotes":0,"teleCoopStack":0,"autoProgs":0,"telePlatform":0,

Android bluetooth, override pairing prompts

霸气de小男生 提交于 2019-12-13 04:40:04
问题 Assume a device has never seen another device before, in this setup it will know of its device mac address already and simply try to pair that device to determine if it is in range now How can I override the pairing dialogue? 回答1: I don't think you can override the pairing dialogue. But I think it is possible to do what you are trying to do. If you initiate a device discovery and register to receive the ACTION_FOUND intent. http://developer.android.com/reference/android/bluetooth

Read multiple characteristics from an Android device using library RxAndroidBle

。_饼干妹妹 提交于 2019-12-13 03:48:10
问题 I am using the library RxAndroidBle in order to scan devices and then connect to one specific device and read 4 GATT characteristics. I can read one characteristic (Battery Level) ith this code : scanSubscription = rxBleClient.scanBleDevices( new ScanSettings.Builder() .build() ) .observeOn(AndroidSchedulers.mainThread()) .doOnNext( scanResult -> { if(scanResult.getBleDevice().getName() != null){ if(scanResult.getBleDevice().getName().equals("NODE 1")){ Log.e("BLE SCAN", "SUCCESS"); Log.e(