So I got my app finished(functioning the way I want, at least), with a bit of a problem. It uses up more battery than I'd like...A little over 1% an hour, I think? While it's running, anyway. Which wouldn't be a problem if the main purpose/idea was to have it running the majority of the time. At any rate, I wanted to ask if anyone had any pointers/tips to reduce battery usage/what uses battery up the most in CIQ apps/etc.
To give a brief overview of what the app does...It's essentially a "watch-face"-app(It's a CIQ-app, not a watchface, just essentially acts like one), that does some things in the background. So essentially, it has a timer that ticks a function every minute(60000 milliseconds). This function, every minute, uses the Sensor(with permission), to get the current heart rate/bpm, and increments a counter if it's not null. Every time the counter ticks to 30, it stores the average in an array using setProperty(...). There are 7 of these arrays, 1 for each day of the week, and another 7 for the timestamps for those heart rates.
I was thinking it wouldn't drain very much battery since the "bulk" of the work only happens once every 30 minutes, but it seems I'm mistaken. Do set/get properties really take up that much battery? Is it because I'm using the Sensor permission? Not really sure what takes battery in CIQ apps. I can elaborate more on what the app does, if needed, but any general advice would be appreciated.
Thanks