The Battery Status API, documented by W3C, is a browser-based API that enables web developers to discover the battery life of a hosting device. This enables web application features to be dynamically catered to a device's battery status, improving power-efficiency and user experience. The API dependences include EcmaScript and WebIDL version 2. The Battery Status API was historically packaged within the W3C System Information API but was excluded to promote additional efficiency and easier implementation. Documentation for the API is in the form of a brief written by W3C and representatives from Intel and Google, including code samples and additional reference material.
The following is a list of sample source code snippets that matched your search term. Source code snippets are chunks of source code that were found out on the Web that you can cut and paste into your own source code. Whereas most of the sample source code we've curated for our directory is for consuming APIs, we occasionally find something interesting on the API provider side of things. If you know of some sample source code that would be of interest to the ProgrammableWeb community, we'd like to know about it. Be sure to check our guidelines for making contributions to ProgrammableWeb.