Google's Chrome development team regularly implements new APIs to extend the possibilities for web apps to behave more like their native counterparts. The most recent addition to the Chrome dev channel allows web developers to use Bluetooth to communicate with nearby hardware. This could be used for things like an online fitness tracker that gets data from a heart rate monitor or for a controller to drive a Sphero, all without installing a native app.

These things are possible with the new Web Bluetooth API. Still in the early stages of development, this allows a web application to query for Bluetooth devices based on their capabilities, then pass messages back and forth with little or no friction. All of the code can be written in Javascript and there's no requirement that either device be connected to the Internet. A demonstration was done by Vincent Scheib at last week's Chrome Dev Summit where a web page served from Github connected to a PLAYBULB and was able to set colors and modes without any special setup on the phone.

One of the biggest advantages to this approach is that a company could release hardware without building individual apps for each platform. This means products might not have to exclude mobile users on Windows and Blackberry devices, not to mention desktop operating systems.

The Web Bluetooth API is available on the Dev Channel for Chrome OS and Chrome Dev for Android, but only on devices running Android 6.0 Marshmallow. The Chrome browser on Mac OS X has partial support and is next in line for development. Windows will come after that, and then Linux if developers can be found to support the drivers. Both Mozilla and Opera plan to add support to their browsers in the future.

The current implementation on Chrome OS and Android is still very young and lacks a number of basic capabilities. For example, if more than one device is found nearby that offers the requested profile, Chrome automatically picks the first one instead of popping up a chooser dialog. Since this is still considered "experimental," the Web Bluetooth API is turned off by default. It can be enabled at chrome://flags/#enable-web-bluetooth.

If you have time, definitely watch the full presentation at the Chrome Dev Summit (embedded below). The video includes even more demos with a live heart rate monitor, a little toy turtle (with LED lights, vibrating motor, and a speaker), a restaurant buzzer, and a smart parking meter. There are also explanations for how this could be further improved and be used for countless other things.

Developers will want to check out this article on the Google Developers portal with a more detailed explanation and sample code. The official spec is also available.

Download

The APK is signed by Google and upgrades your existing app. The cryptographic signature guarantees that the file is safe to install and was not tampered with in any way. Rather than wait for Google to push this download to your devices, which can take days, download and install it just like any other APK.

Version: 48.0.2564.8

Via: Francois Beaufort

Source: Web Bluetooth API Spec, Google Developers Portal