DMXzone Summer Sale: Save up to 51% with code DMXSUMMER26. Ends in

HTML5: Battery Status API

An introduction to Battery Status API

The number of people browsing the web using mobile devices grows every day. It's therefore important to optimize websites and web applications to accommodate mobile visitors. The W3C (World Wide Web Consortium) is well aware of this trend and has introduced a number of APIs that help with this challenge. In this article, Aurelio De Rosa will introduce you to one of these APIs, the Battery Status API.

 

One of the most irritating limitations of the current generation of mobile devices is their limited battery life. It drives him crazy when the battery of his mobile phone dies when he's out and about. No matter how small and convenient modern smartphones are, you need to remember to carry an adapter with you in case your phone or tablet runs out of juice.

As developers, we can help remedy this issue, but we usually prefer to ignore it. Until recently, developers had a good excuse as there wasn't an API to get information about the device's battery status. That excuse, however, is no longer valid thanks to the introduction of the Battery Status API. Let's take a few minutes to explore what the Battery Status API is all about.

Comments

Be the first to write a comment

You must me logged in to write a comment.