Let’s take a look at some of the use cases.
The number of CPU on the device can be used to measure the number of threads that can be run at once, giving you some insight into the capabilities of the current device.
The example Umar gives here is when using Workers as part of the Web Workers API.
I remember when the battery level was used for nefarious reasons by companies like Uber, where they would raise the cost of the fare if they determined that their customer was about to run out of phone batter (and assumably be stranded without a way home).
My assumption that it was shut off completely is wrong, it turns out that Chromium browsers still allow for this to be used (which is like 74% of the population, so worth using where you can).
If you are going to be using this, I’d recommend using it as a IF the battery is okay then load the additional resources, rather than IF the battery is bad then don’t load the resources. This means that even on browsers that don’t support the API the users will still be a battery boosting performance.
More and more…
Those are just a few of the tips that Umar has provided. You also get insight into how to use
- Network connection
- Device Storage
- Save Data
We’ve all been there. Low battery 🔋️, no charger, and you start clearing apps in the hope that your 4% lasts on the journey home.