W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2011

Battery Status Events Playground

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Thu, 8 Sep 2011 20:02:51 +0300
Message-Id: <022E886D-49A2-4E0C-B47A-C21A3C898891@nokia.com>
To: "public-device-apis@w3.org WG" <public-device-apis@w3.org>

I created a demo which implements the Battery Status Events specification and (naively) simulates battery-powered user agent behavior in JavaScript. You can adjust the battery level and whether the device is plugged in from the controls. A blink of an event name indicates the event has been fired, which should give you a better feel of the intended behavior. Thresholds for batterylow and batterycritical events have been set to level 20 and 10 respectively (a more intelligent implementation would not hard-code these values). To see some internals, peek into see your console.log().

The Battery Status Events Playground is at:


A modern browser with support for <input type="range"> is required (e.g. recent Chrome, Safari or Opera, sadly Firefox does not support this feature at the moment). 

Hopefully this helps people to better understand the current design, its limitations and good parts. And perhaps propose improvements to the design.

Received on Thursday, 8 September 2011 17:03:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:50 UTC