Google officially announced Android O on May 17 at its developer conference, Google I/O. Android O is now available to ordinary users. As in the past, Google had initially released a developer preview version, to give them an overview of the next generation of Android[1]. Let’s take a look at what Android O means for Bluetooth® developers.

First of all, I’d like to tell you how Android versions are named. Google uses letters of the alphabet, allocated at each new release in alphabetical order. Those letters tend to be associated with a dessert name or type of confectionary (presumably just for fun!) but also have a more traditional version number too. For example:

  • Android 4.3, elly Bean
  • Android 4.4, itKat
  • Android 5.0, ollipop
  • Android 6.0, arshmallow
  • Android 7.0, ougat
  • Android 8.0, (rumored to be short for “Oreo” )

Although Android’s version naming is interesting, it may surprise you to learn that the aim of this article is not to discuss the names of desserts, biscuits and so on. In fact, my aim is for everyone to understand the next generation of the Android operating system and its APIs and what the new Bluetooth features are that it contains.

From the latest Android developer reference guide, we can see that there are two major sets of changes relating to Bluetooth. Support for aspects of Bluetooth 5 and some changes relating to Bluetooth audio.

Bluetooth 5 Support

Bluetooth® 5 was released last December and consists of three major features: 4x longer range, 2x higher speed and 8x ADV packet length. The Android O APIs include changes relating to Bluetooth 5 For example:

a. setPreferredPhy method

void setPreferredPhy(int txPhy,     int rxPhy,      int phyOptions)

With the setPreferredPhy method, you can configure the Bluetooth low energy PHY layer for your Android device. The physical layer of Bluetooth 5 low energy includes three options: 1M PHY, 2M PHY, and Coded PHY.

The parameters to setPreferredPhy, txPhy and rxPhy, are defined as follows:

The parameter for setPreferredPhy, phyOptions, accepts the following values:

setPreferredPhy allows, therefore, the selection and configuration of Bluetooth 5 long range,  Bluetooth 5 high speed or the LE1M PHY which is compatible with both Bluetooth 4.x and Bluetooth 5 devices.

PHY_LE_1M_MASK

PHY_LE_2M_MASK

PHY_LE_CODED_MASK

PHY_OPTION_NO_PREFERRED

Compatible with 4.0, 4.1, 4.2, 5.0

High speed

PHY_OPTION_S2

Long range (x2)

PHY_OPTION_S8

Long range (4x)

But one thing to emphasize here: the long range and high speed features are supported only if the Android device hardware supports Bluetooth 5.

For more detail about the long range and high speed Bluetooth APIs in Android O, please refer to https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html

b. ADV Extension

In Android O there are also some changes to the ScanRecord.getBytes()[2] method relating to record length. When an Android application starts a Bluetooth low energy scan, it calls startScan(ScanCallback) in code. ScanCallback is an object which implements a callback function and it is invoked as advertising packets are received. The call to the callback function passes a ScanRecord object as a parameter and the ScanRecord.getBytes() method returns the raw bytes of the scan record i.e. of the advertising packet.

Android O makes the following changes to the length of the data that ScanRecord.getBytes() method returns: the method makes no assumptions as to the number of bytes in the advertising packet. Therefore, applications should not rely on there being any particular minimum or maximum number of bytes returned. Instead, they should evaluate the length of the resulting array. Bluetooth 5 devices may return a data length exceeding the previous maximum of ~60 bytes. Note that if a remote device does not provide a scan response, fewer than 60 bytes may be returned.

Meanwhile, Bluetooth 5 support in Android O includes other features relating to the ADV extension, like below method, startAdvertisingSet:

void startAdvertisingSet (AdvertisingSetParameters parameters,                AdvertiseData advertiseData,               AdvertiseData scanResponse,                PeriodicAdvertisingParameters periodicParameters,               AdvertiseData periodicData,                   int duration,                   int maxExtendedAdvertisingEvents,               AdvertisingSetCallback callback)

“Advertising Sets” are a feature of Bluetooth 5 which allows multiple, distinct sets of advertising configuration parameters, including the advertising data payload and timing parameters, to be set up and the Bluetooth controller informed of them.

From the startAdvertisingSet method, you can see that we also have support for the new Bluetooth 5 periodic advertising capability as well as the extended advertising feature. You’ll find more information in the Android developer reference guide: https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser.html

Bluetooth Audio

Android O also released additional support for Sony LDAC[3]. LDAC is an audio coding technology developed by Sony that enables the transmission of High-Resolution (Hi-Res) Audio content, even over a Bluetooth® connection. This technology can improve the transmission throughput of Bluetooth audio signals at a maximum of 990kbps. With LDAC support, LDAC-enabled headsets and speakers would be able to connect with Android O devices and have a high-quality audio experience.

LDAC has 3 options for transmission rate:

  • 990kbps, Quality priority mode
  • 660kbps, Normal mode
  • 330kbps, Connection priority mode

It looks like Android O also supports Qualcomm’s aptX and aptX-HD as well, giving developers plenty of options for using audio over Bluetooth.

Device Deployment

Currently, Android O developer preview is still in Beta and is available to test on some Nexus and Pixel devices, such as Nexus 5X, 6P, and Player, as well as Pixel, Pixel XL, or Pixel C device.

It’s Time for Bluetooth 5

Developers, don’t hesitate! It’s time for you to start developing applications which exploit the power of Bluetooth 5!


[1] O-MG, the Developer Preview of Android O is here! https://android-developers.googleblog.com/2017/03/first-preview-of-android-o.html
[2] Android O behavior changes – Bluetooth,  https://developer.android.com/preview/behavior-changes.html#bt
[3] LDAC introduction, https://www.sony.net/Products/LDAC/

Bluetooth Developer Journey

As a leading player in the semiconductor industry committed to the development of cutting-edge…

Generic Health Sensor Design and Implementation Guide

The Generic Health Sensor (GHS) Design and Implementation Guide guides implementers of health sensor…

Doom running on Silicon Labs & Sparkfun Microcontrollers: A Quick Look

Doom has recently reached its 30th anniversary, yet it remains a masterpiece and a…

Auracast Simple Transmitter Best Practices Guide

This paper provides a set of clear, concise, and useful recommendations for product makers interested in building Auracast transmitter products.

5.7 km of Bluetooth® Range

40 km from Irvine, California gets you to beautiful Newport Beach Pier, and 5.7…

Synthesize and Transmit Audio Using LE Audio

The application is assembled as a sound-generating device, the synthesizer, and a receiving headphone.…

Unveiling the Truth: Debunking Bluetooth’s Biggest Myth

Bluetooth Low Energy was designed to considerably reduce power consumption and cost while maintaining…

Bluetooth® Mesh Feature Enhancements Summary

This paper summarizes the recent Bluetooth® Mesh feature enhancements and provides references to other…

The Latest in HADM with Bluetooth LE

HADM, or high accuracy distance measurement using Bluetooth does exactly what it says –…

Mr. Beacon Podcast: Snapdragon Sound with Mike Canevaro

This episode of the Mr. Beacon Podcast explores the revolutionary world of Bluetooth audio.…

Top 10 Auracast™ Resources

It’s been almost a year since the Bluetooth Special Interest Group (SIG) released Auracast™…

Features and Benefits of Bluetooth Mesh 1.1 for Wireless Mesh Networking

Commercial and industrial applications like lighting require large-scale, low-power device networks where thousands of…

The Bluetooth® Low Energy Primer

Are you new to Bluetooth Low Energy? Learn about its constituent parts, features, and how it works.

Bluetooth® Technology for Linux Developers

Learn how to use the interprocess communication system D-Bus and the BlueZ APIs to create Bluetooth applications for Linux computers.

Designing and Developing Bluetooth® Internet Gateways

Learn about Bluetooth® internet gateways, how to make them secure and scalable, and design and implement your own...

 Get Help