BluetoothGattService

This class is responsible for holding different parameters and functionalities related to the Bluetooth Service. BluetoothGattService gives flexibility to the developer to get the characteristics related to that service which is significant for writing and reading data to and from the Bluetooth characteristics. A quick view of the methods offered by this class can be found here:

IntelliSense offered by Android Studio to list BluetoothGattService class.

A service can be acquired by calling getService method on mBluetoothGatt object after connecting to a particular device:

 BluetoothGattService service = mBluetoothGatt.getService(UUID.randomUUID()); ...

Get Building Bluetooth Low Energy Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.