Bluetooth GATT send data to BLE device - bluetooth

how can I send Data to BLE device. I already Connected to ble device but don't know how to send and receive data Via Gatt Callback.

Have a look at the following resources that should help you get started:-
Ultimate Guide to Android BLE Development
Building Android Apps to Control Bluetooth LE Devices
Android Lollipop: BLE Matures (video)
Bluetooth LE Send String Data Between Two Devices
How to Use Android BLE to Communicate with Bluetooth Devices

Related

Can chrome web bluetooth api connect to a Bluetooth V4 device?

I have read that Web Bluetooth API can connect to Bluetooth BLE devices. I understand that BLE is a part of Bluetooth V4, but will Web Bluetooth connect to a regular V4 device that is not BLE?
The version number in Bluetooth is mostly irrelevant. More optional features are added in every new version, but that's it. BLE was added in version 4. "Regular V4 devices" does not make sense. If you refer to "Bluetooth Classic" or BR/EDR devices, these are not BLE devices. However you will be able connect to these devices in Web Bluetooth if they run a GATT server, if the OS supports it, since GATT can also run over BR/EDR.

Bluetooth Android and Bluetooth iOS

When I press a button on a device that is connected to iOS or Android via Bluetooth, it should perform some task in an app(app installed on iOS or Android). I am not sure which Bluetooth profile will be best for my job. I think HID profile, but will it work with iOS ? Any suggestions or comments are welcome.
iOS devices can't use standard Bluetooth connection with Android. In this case you should use BLE (Bluetooth Low Energy). This means you should use GATT profile for Android. There is an important issue here: all iOS devices can BLE peripheral or central but for Android some devices only can peripheral.

Does the HC-05 bluetooth device support AVRCP commands?

I am trying to control the android music player from an Arduino with an HC-05 Bluetooth module. I have successfully paired them in serial mode but have been unable to find any means to connect them with the AVRCP profile. Is there a library that I can load into a sketch to do this?
The HC-05 supports SPP only. In order to get any other BlueTooth profile on there, you would have to create and flash different firmware for the Broadcom BC417143.

Android Bluetooth LE Chat example

I am trying to read serial data over Bluetooth LE but can't find any code examples for this type of bluetooth and api19. Does any one have an example?
There is no profile defined for serial data communication over Bluetooth Low Energy till now. For this one can use the Bluetooth classic only.
In any case, Android devices can not broadcast for advertising packets. They can only scan the advertising packets. Hence, these devices will be in Central mode only. But can act as either server or client.
For Bluetooth chat related app example one can refer Android SDK as,
sdk/samples/android-19/legacy/BluetoothChat
The above example is based on Bluetooth classic based on RFCOMM channel for serial communication.
Android 5.0 let mobile to be peripheral. So chat will be possible:
https://developer.android.com/about/versions/android-5.0.html
Bluetooth Classic got the SPP profile. This is not how Bluetooth Low Energy works.
In BLE you have 1 or more Services each with 1 or more Characteristics which are basically just bytes in a predefined format which by default can be max 23 bytes.
To send data from one device to another one must be the Master and the other must be Slave.
Android API19 does not support the Slave (Peripheral) role, it seems Google still doesn't understand the importance of Bluetooth Low Energy. It's so much more than just Pulse-readers.
You can send from an Android API19 phone to e.g. an iPhone which can be Slave/Peripheral.
You cannot send from an Android API19 phone to another API19 phone. For this you must use Bluetooth Classic SPP profile.

Phone as Bluetooth Headset

I need my phone to act like a Bluetooth headset.
I am planning to run a J2ME application in Phone to make Phone as Bluetooth Headset.
Any idea how to do this?
Can't be done in J2ME as the Bluetooth API supports only SPP and L2CAP (and occasionally OBEX). Bluetooth headsets require the Headset profile.

Resources