5 ms·
Who seriously thought the Battery Status API was a good idea? Someone thought this was useful enough to write a spec for it...
by fenwick67 7y ago
Who seriously thought the Battery Status API was a good idea? Someone thought this was useful enough to write a spec for it...
- iameli 7y agoFullscreen games providing a battery indicator is always nice.
- fenwick67 7y agoSeems legit, although that should probably be the OSes job to overlay that
- deadmutex 7y agoThat has its own set of challenges -- now you have to design your game so that the battery indicator doesn't cover up an important part of the game. Also, what if the OS allows it to be configurable location/size, etc.
- fenwick67 7y agoI was imagining a pop-up saying "your battery is getting low"
- CraneWorm 7y ago> now you have to design your game so that the battery indicator doesn't cover up an important part of the game You should not be able to do that; It's a feature that you cannot do that.
- deadmutex 7y ago? You should not be able to re-layout your visual elements in the game if the battery indicator hides it?
- zzo38computer 7y agoMostly agreed. However, if the screen is split into the system area and document area, then the battery indicator could go in the system area, and the game need not know where it is; only the size of the document area needs to be known by the game (and not whether or not the system area is present, what it contains, etc).
- saagarjha 7y agoSounds like a job for safe area insets.
- deadmutex 7y agoThanks! I did not know about these before. It looks like a step in the right direction. Though what would be the next step? It seems like there would still the complexity of laying out all the controls/HUD (or other visual elements) in the game.
- saagarjha 7y agoWell, it's not going to fix the layout for you, but it'll ensure that it won't end up under a curve of the screen or behind some UI protrusion.
- tmpz22 7y agoEmergency tools could benefit from knowing if the device was about to die or not, like the Tinder SOS app, government emergency tools, etc. Imagine sending a quick POST request to save session state or whatever before it dies.
- duxup 7y agoI suppose you're doing what might be a resource intensive task and want to be sure you don't kill the battery. Granted I get folks might feel a rando website that is resource intensive would be horrific, but maybe we're talking about some specific web app / use case.
- zzo38computer 7y agoEven so, I think battery API is not the proper way to do it. Some sort of interrupt command (like UNIX has) may be better.
- rwnspace 7y agoAgreed. Maybe only useful for laptops used as 'kiosks' (launching directly to app without a window manager)?