23 Sep 2014

Health Sensor Integration On Android Jelly Bean 4.2

In this article we provide a demonstration of integrating medical sensors with Android in order to leverage applications to track healthcare information.

Background On Android Sensors

Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions. These sensors are capable of providing raw data with high precision and accuracy, and are useful if you want to monitor three-dimensional device movement or positioning, or if you want to monitor changes in the ambient environment near a device. For example, a game might track readings from a device’s gravity sensor to infer complex user gestures and motions such as tilt, shake, rotation, or swing.

The Android platform supports three broad categories of sensors:

  • motion sensors
  • environmental sensors
  • position sensors

In the Android system, some of the sensors are hardware-based, while others are software based.

Android allows application developers to obtain the raw data from these sensors in order to be able to then use it in the application. For this purpose, Android provides user with some Viz class files: SensorManager and Sensor.

Therefore, one can access the sensors available on the device and acquire raw sensor data by using the Android sensor framework. This sensor framework provides several classes and interfaces that help you perform a wide variety of sensor-related tasks. For example, the sensor framework can be used to do the following:

  • determine which sensors are available on a device
  • determine an individual sensor’s capabilities – such as its range, manufacturer, power requirements, and resolution
  • acquire raw sensor data and define the minimum rate at which you acquire sensor data
  • register and unregister sensor event listeners that monitor sensor changes

The interface between the hardware drivers and the Android framework is known as the Sensors Hardware Abstraction Layer (HAL) API. And the Sensors Software Development Kit (SDK) API is the interface between the Android framework and the Java applications.

If one registers a “SensorEventListener” object for a sensor, whenever the sensor data changes, the listener will be notified.

Depending upon usage and the nature of the sensor, it’s possible to enable or suspend sensor using onPause() and onResume methods.

The rest of this post describes a proof of concept activity for the integration of the sensor at a middleware level to the Android Framework.

Goals Of The Activity

  • add support for a new category of sensors in Android framework: Medical Sensors
  • connect a medical sensor to the Android platform and develop a working prototype where an Android application is able to:

                   detect the connected medical sensor device

                   receive data from the medical sensor

Hardware Description

Visit our blog to read more. Have an embedded Android project? HSC can help! Get in touch with our experts and let us know what we can do for you.