Hi,
what to look for or what to do for a watch app to optimize battery life ? I am looking for some advice to tune my code to have a better battery life in my app.
Hi,
what to look for or what to do for a watch app to optimize battery life ? I am looking for some advice to tune my code to have a better battery life in my app.
It's common in device apps to have a timer to update the screen, often every second. Updating the screen consumes battery.
What you can easily try with a sideload is just make that timer longer, say…
maybe if you ran the profiler on the device, but not in the sim. If I recall, it's the -k flag for the compiler.
But I've never used it
It's common in device apps to have a timer to update the screen, often every second. Updating the screen consumes battery.
What you can easily try with a sideload is just make that timer longer, say every 2-5 second.
Check the battery usage after a few hours with the original app and do the same with with the longer timer. You should see better battery numbers with the longer timer. Based on your app and what else it does, you may need a fairly long test. GPS for example consumes great deal of battery all by itself and may make this change hard to see.(But some GPS configurations do consume more battery than others - multi-band vs just GPS for example)
Then, look at specific screens. Lets say you have one that displays the sunrise/sunset or weather - you don't really need those screens to update every second, as the data doesn't change that often. Sunrise/sunset only changes once a day, and even if you display something like "time to sunset", you can get by with updating that screen once a minute. Based on what your app does, there may be other things where you can update the screen less frequently