Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Android Marshmallow adds 'high fidelity sensor support' flag for developers

Derek Walter | Nov. 5, 2015
Google's new developer tool helps reduce the pain of a common Android fragmentation problem.

android marshmallow
Credit: Google

Google is empowering developers with new tools to better deal with wonky sensors, which have long been a sore spot of Android fragmentation.

According to the Android 6.0 Compatibility Definition Document, devices whose sensors are accurate to within very strict tolerances can set a new flag: android.hardware.sensor.hifi_sensors. Devices whose accelerometer, gyroscope, compass, barometers, step detectors, etc. all deliver data with high accuracy and broad range must set this flag. This is a boon for developers, who can look for a single value and know it can rely on the sensor data being accurate (or at least, put up a warning message to users that their device might deliver a sub-par experience).

Currently, developers can look at various flags to determine if a device as a particular sensor or not, but they have no way of knowing if it delivers precise, low-latency data.

The Android compatibility document also lays out power requirements so hardware manufacturers can build in sensors that will work as Google intends. Devices don't have to meet the new requirements, they're entirely optional, but the existence of a standardized way to tell developers they can rely on sensor data being accurate and fast will be a big help in cutting down one of the prominent pain points in Android fragmentation.

Why this matters: One of the reasons certain apps appear first, or only, on iOS is because iPhones deliver very consistent sensor data from one model to the next. Android phones, in being so diverse, often give wildly different results. What's more, developers can't rely on the results being delivered in a timely, low-latency fashion. Google is making it easier, if optional, for developers to know if a device provides high-quality, reliable, fast sensor data. In time, you may start seeing applications that are especially sensor-dependent (like running trackers or motion-sensitive games) throw up a warning on devices that don't set the android.hardware.sensor.hifi_sensors flag.


Sign up for Computerworld eNewsletters.