JetCracker

Life-time learner's blog

Tag Archives: CardioMood

Speedometer Gauge with Needle for Android

I am working very hard on my CardioMood app for Android.

As described in one of my previous posts, CardioMood is a health monitoring social service with a stress monitor app. It measures your stress level according to heart rate variability. It also shows a bunch of other parameters, which are represented as different kinds of charts.

Stress Index is a quantitative characteristic of your stress. Normally, the value of Stress Index varies from 50 to 150. The SI value outside of the range could be caused by a number of factors, such as physical or emotional stress, diseases (including heart diseases), and low quality of data obtained from heart rate sensor.

In CardioMood Stress Monitor app, we need to visually represent a calculated value of Stress Index – and that is another problem. I decided to use a speedometer-like gauge.

A simple way: WebView

In our measurement report screen used WebView to visually represent the result.

Android WebView supports almost all HTML and javascript features, which enables developers to render anything and use various javascript libraries already available on the net.

So, WebView gives you an easiest way to add Speedometer gauge to your android app. In our case we used a solution from Geek’s Retreat.

Their implementation is purely javascript. It has a certain number of limitations. For example, you have to specify the exact width and height of the canvas before rendering.

We had hard time with sizing and layouting components in WebView. Soon, we realized that WebView is not reliable – it’s better to use native controls than spend days on fixing issues and supporting diverse screen densities and sizes in HTML.

Hard way: Implementing Android custom view

I decided to take a bull by the horns and convinced our team to stop using WebView. After two days of working, I finally created SpeedometerView – a simple speedometer with needle gauge for Android. It looks similar to it’s javascript brother and has the same features.

CardioMood SpeedometerView in action

Supported features:

  • Major and minor tick marks
  • Custom labels
  • Colored value ranges
  • Animation of arrow (requires Android API level 11+)

Download

Check out a GitHub repo to see source code, release binary and usage example.

UPD: The component was moved to AndroidWidgets library.

GitHub: https://github.com/ntoskrnl/AndroidWidgets

Screenshot of CardioMood with SpeedometerView

Feel free to comment, request features or report bugs.

Advertisements

CardioMood Stress Monitor for Android

CardioMood.ComI’d like to introduce an Android application for our CardioMood health service, which is going to revolutionize today’s health & fitness approaches.

You can evaluate your stress level and estimate health of your heart.

Download from Google Play!

ImageImage

Feel free to rate this app and leave your feedback.

Key features

  • Displaying current heart rate
  • Analyzing stress level (by heart rate variability)
  • Different visual representation of collected data with description
  • Storing all your measurements locally
  • Saving results to PNG-images or TXT-files
  • Uses Bluetooth Low Energy (Bluetooth SMART) technology

This application doesn’t use or require any network connections and can be used safely.

Limitations

  • This application is standalone and currently supports devices with Bluetooth 4.0 Low Energy (Motorola phones with Android 4.0+ and other phones with Android 4.3+).
  • The application currently supports only Polar H7 heart rate monitor (was tested and proved to be working).
  • Devices with small screens are currently not fully supported (we are working on it).

This is a demo. In the future we are going to support a much wider range of Android devices and heart rate monitors.

Stay with http://www.cardiomood.com !