android-bluetooth

Scanning large number of BLE Tags

巧了我就是萌 提交于 2019-12-04 05:20:19
I was looking for a possibility to scan a large number of BLE Tags (StickNFind) in a single scan. I have noticed that when I scan for 10 seconds I can detect around 20 BLEs easily. When I increase the scanning interval to around 30 seconds and try to scan a large number of BLE Tags e.g. 200 Tags, I see an error in the LogCat about buffer overflow (GKI_exception). This problem occurs somewhere in the core Android libraries, which I am unable to debug. The exact error log is attached. 11-27 11:39:30.542: D/dalvikvm(1017): GC_CONCURRENT freed 412K, 8% free 9039K/9760K, paused 1ms+1ms, total 16ms

Android stops finding BLE devices: onClientRegistered() - status=133 clientIf=0

a 夏天 提交于 2019-12-04 01:37:43
I am developing an app in which I can both find and configure BLE devices. I am using standard Android BLE API, but recently I've encountered some strange problems. When I turn on my app the BLE scan works OK. I am scanning using: mBluetoothAdapter.startLeScan(mLeScanCallback); // for Kitkat and below and mBluetoothAdapter.getBluetoothLeScanner().startScan(mScanCallback); // for Lollipop and above In the Logcat I am getting following messages (I guess this is important for this issue): D/BluetoothAdapter: onClientRegistered() - status=0 clientIf=5 In my app I can also read certain

BLuetooth Gatt Callback not working with new API for Lollipop

不问归期 提交于 2019-12-04 00:17:30
I currently have a method which writes to the BLE devices to beep it. My Bluetooth Callback goes as follows : ReadCharacteristic rc = new ReadCharacteristic(context, ds.getMacAddress(), serviceUUID, UUID.fromString(myUUID), "") { @Override public void onRead() { Log.w(TAG, "callDevice onRead"); try{Thread.sleep(1000);}catch(InterruptedException ex){} WriteCharacteristic wc = new WriteCharacteristic(activity, context, getMacAddress(), serviceUUID, UUID.fromString(myUUID), ""){ @Override public void onWrite(){ Log.w(TAG, "callDevice onWrite"); } @Override public void onError(){ Log.w(TAG,

An extensive project: Streaming audio from microphone to Android device

蓝咒 提交于 2019-12-03 22:16:10
问题 I want to take audio input from a Bluetooth microphone and stream it out loud--like a megaphone or a simple PA system-- and broadcast it in real-time . For this purpose I am using the AudioRecord and AudioTrack classes--since MediaRecorder and MediaPlayer writes and reads to an external file, which I could imagine delays the audio much more than necessary (is this true?). I have discarded the idea of using any Bluetooth classes since the Android API doesn't support the Android device as a

Scanning of Bluetooth Low Energy Fails

旧巷老猫 提交于 2019-12-03 21:25:32
问题 I am currently developing an application that will use Bluetooth Low Energy. I am using the following link, http://developer.android.com/samples/BluetoothLeGatt/src/com.example.android.bluetoothlegatt/DeviceScanActivity.html I am not able to scan the surrounding BLE devices. To scan device, mBluetoothAdapter.startLeScan(mLeScanCallback); private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device

Not receiving data from BLE device

纵饮孤独 提交于 2019-12-03 20:36:29
I'm here again. So, long story short: in my app I'm trying to receive datas from my BLE device (tickr heart rate monitor: that ) with the help of Android Samples ( that ). But... I'm not receiving datas from my device! I'm able to get the Characteristics and the Descriptor, but... nothing more. I simply.. miss the point . Here's my code: private BluetoothLeService mBluetoothLeService; private ArrayList<BluetoothGattCharacteristic> mGattCharacteristics = new ArrayList<BluetoothGattCharacteristic>(); private BluetoothGattCharacteristic mNotifyCharacteristic; public static final String EXTRAS

Bluetooth “out of band” (OOB) pairing on Android?

馋奶兔 提交于 2019-12-03 17:47:24
问题 I've been searching the internet and haven't seen anything in the way of how to exactly implement OOB pairing. I was hoping somebody here could point me to some example code to help me out. The chat example in the Android developers site didn't really dive into this type of pairing at all. Basically, I have an Android tablet that I want to securely pair with a device, written in C++, that has no built in display/IO mechanism. The tablet to be paired will act as the GUI/IO interface and I'll

Android Bluetooth : get Device Specific AT commands

你说的曾经没有我的故事 提交于 2019-12-03 15:31:30
I am using " android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT " intent to get device specific AT commands. But the broadcastreciever didn't fire when I send AT command from MY Bluetooth Kit. When I send AT+CHUP\r from my kit the android work on this command internally and disconnects the call. But when I send AT+XEVENT=foo,3\r from kit but I am not getting any thing in receiver. Help me out I also had a hard time getting the vendor specific headset event to work, but finally figured it out. You have to add the Category of vendor specific events you want to receive to the

How to programmatically pair and connect a HID bluetooth device(Bluetooth Keyboard) on Android

时光总嘲笑我的痴心妄想 提交于 2019-12-03 12:32:40
问题 I am able to pair a bluetooth keyboard but not able to connect so as to make it an input device. I went through the documentation provided at developer site - http://developer.android.com/guide/topics/connectivity/bluetooth.html#Profiles It says that the Android Bluetooth API provides implementations for the following Bluetooth profiles but you can implement the interface BluetoothProfile to write your own classes to support a particular Bluetooth profile. Headset A2DP Health Device There is

BLE Android - onConnectionStateChange not being called

半城伤御伤魂 提交于 2019-12-03 11:17:26
问题 I have a problem trying to connect to a peripheral. Sometimes the callback onConnectionStateChange(...) is not called after BluetoothDevice#connectGatt(...) . What I'm trying to achieve is fast and short connections triggered by user action. This situation occurs about 1 in 10 times without specific prior action. It lasts about 20 to 30 seconds or until the application is killed and reopened. The normal sequence of steps I follow is: Scan devices to find the peripheral. Call BluetoothDevice