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>
Hi,

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:

  http://dev.w3.org/2009/dap/docs/battery-status/battery-status.html

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.

-Anssi
Received on Thursday, 8 September 2011 17:03:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:22 GMT