Dear Community,
I'm trying to build a power- (and, respectively, compute-) efficient Watch Face.
I have hardcoded all the possible Hands coordinates, as well as some elements positions, and store them in array, which is accessed every time the Hands are drawn. It may be an overkill, but I believe accessing an array has less power impact than calculating sinus twice (for Hours and Minutes) per minute. Also, caclulating this array in Excel was easy.
I have several (currently 2) arrays for 240 and 260 pixels screen sizes. The array is loaded on onLayout() based on the check of screen size. With this approach now, my Watch Face consumes more than 60 kB out of 91 kB memory. I'm estimating that 1 array takes about 25 kB. I can load them on onUpdate(), but that's less eficient, but still can work.
I would like to support more screen resolutions (e.g. for Venu), potentially all round-face models, but I need to find a way to load only the necessary array into the memory, and avoid keeping the unneeded onces.
Alternative approach, which will work but I don't like, is to have only one array for most common screen size (240?) and in case of other screen size do the multiplication of array elements on k, where k = actual screen resolution / 240 during onLayout()
Any ideas?