Battery API Testing With Networked Applications

Hello All,
Pardon me for the clumsy wording in the subject line.  At the DAP F2F at the last TPAC, I raised some concerns regarding testing of the Battery API and how well the readings match the system level power meter. I am particularly interested in how developers can use this API on power-limited devices.  I explored the Firefox implementation (Win7 version) with respect to a WebSocket application using a loopback server running at localhost.  I am enclosing the client-side code as FYI, but you cannot execute it without a corresponding ws-compatible server.  I am enclosing also a presentation summarizing my observations (which I hope to go over during the next DAP telco), and a screenshot of the application results along with the system power meter app.  Note a couple of items:

a) I am proposing that the battery API be tested in an application that requires networking transactions at a certain frequency.  This would require a server, either running at localhost or somewhere in the cloud, to receive messages from the web application.
b) I am not suggesting with the results in the slidedeck that there is any kind of bug in the Mozilla implementation of Battery API.  I believe such a conclusion is premature -  I would never offer myself as any expert in JS programming and there could be a simple fix available to coax the proper readings out of the mozBattery implementation for which I am unaware.  I just want to see tests for the Battery API that are similar to the application I have written. 

Thanks,
-Giri Mandyam, Qualcomm Innovation Center

Received on Sunday, 3 February 2013 22:25:31 UTC