

They just want an easy, quick connection process – BLE does this wonderfully. These healthcare devices are normally handled by carers or vulnerable people who do not want to go through the hassle of pairing bluetooth devices, or entering PIN codes, etc. It is particularly interesting to me when applied to healthcare devices, for a number of reasons: Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.Bluetooth Low Energy (also known as Bluetooth v4) is the current standard in Bluetooth Technology.
ANDROID STUDIO BLUETOOTH TUTORIAL CODE
SeeĬontent and code samples on this page are subject to the licenses described in the Content License. You could alternatively design your app to play the GATT server role. Rate monitor that supports the Heart Rate The app gets data from the GATT server, which is a BLE heart
ANDROID STUDIO BLUETOOTH TUTORIAL ANDROID
In the example used in this topic, the app (running on an Android device) is To receive updates from the phone, then it might make sense for the phone to For example, if theĪctivity tracker wants to report sensor data to the phone, it might make senseįor the activity tracker to act as the server. They transfer, one or the other might act as the server. Start transferring GATT metadata to one another. Once the phone and the activity tracker have established a connection, they Things that only support peripheral couldn't talk to each other, nor could two To establish a BLE connection you need one of each-two

The phone supports the central role the activity tracker supports the Imagine that you have an Android phone and an activity tracker that is a BLEĭevice. Other once they've established the connection. This determines how two devices talk to each The peripheral role makes the advertisement. Theĭevice in the central role scans, looking for advertisement, and the device in This applies to the BLE connection itself. The following roles and responsibilities apply when a device interacts with aĬentral versus peripheral. "heart rate measurement." You can find a list of existing GATT-based profiles Service called "Heart Rate Monitor" that includes characteristics such as Service A service is a collection of characteristics.ForĮxample, a descriptor might specify a human-readable description, anĪcceptable range for a characteristic's value, or a unit of measure that is Descriptor Descriptors are defined attributes that describe a characteristic value.A characteristic can be thought of as a type, Characteristic A characteristic contains a single value and 0-n descriptors that describe theĬharacteristic's value.The attributes transported by ATTĪre formatted as characteristics and services. ID used to uniquely identify information.

Unique Identifier (UUID), which is a standardized 128-bit format for a string Each attribute is uniquely identified by a Universally To this end, it uses asįew bytes as possible. Attribute Protocol (ATT) GATT is built on top of the Attribute Protocol (ATT).For example, a device could contain a heart rate monitor and a Note that a device can implement more than one A profile is a specification for how a device works in a Profiles The Bluetooth SIG defines manyįor BLE devices.All current BLEĪpplication profiles are based on GATT. Pieces of data known as "attributes" over a BLE link. Generic Attribute Profile (GATT) The GATT profile is a general specification for sending and receiving short.The following is a summary of key BLE terms and concepts: Needs to access the BluetoothAdapter and determine if Bluetooth is availableĪvailable, the device will scan for nearby BLEįound, the capabilities of the BLE device are discovered by connecting to theĬonnection is made, data can be transferred with the connected Once your app has permission to use Bluetooth, your app Use of the Bluetooth LE APIs requires you to Using BLE, the data that's communicated between the two devices isĪccessible to all apps on the user's device.įor this reason, if your app captures sensitive data, you should implementĪpp-layer security to protect the privacy of that data.įor BLE-enabled devices to transmit data between each other, they must firstįorm a channel of communication. Caution: When a user pairs their device with another device
