Is there a limit of how many conditional lines we can have in a project?
I am trying to create a watch face which shows unique text for every minute of day, so that would be 1440 minutes in total → at least that many conditional lines and text boxes.
I have done similar clock in Python and C#, where I solved it not by 1440+ lines, but by queries into json DB (look up and display entry that corresponds to the current minute), but that is not an option with WFS obviously.
Also, how would having that many conditional lines (and even more text boxes) affect the performance of watch face / battery life?
Ha Ha . That will be a lot of work . Ready for next Christmas I should Wonder . The great thing about WFS is you can see how big your Files are . I would do a test where you add 10 Conditional lines to a basic Face and see what the load is . I have no Idea what a limit might be. But 20 MB would seem to me to be big .
Presumably your Python / C# was on a Raspberry Pi or something like that not a Watch .
A lot of work, yes. I have by now made about 550 conditional lines and the apk is about 3.8MB. So, yes, it seems the whole project would be like 20MB easily. And yes, it would seem way too big for a watch face. (?)
The C# was just a standalone app for Windows, and Python was just a Python code that can be run anywhere. Not watch faces.
Any ideas how to build a watch face which shows unique text for each minute of day and night? I guess it would need to be some sort of querying from json, and that would not be possible with WFS … ??
You have one image that has all the unique text for each minute (24 across and 60 up and down) and you move the position either up or down left or right determined by the time. The layer above has a hole for the minute to show through and hides everything else.
It will take a bit of math to set the position but shouldn’t be that complicated. 24 conditions to set the hour left and right and then just add the minutes times a factor to set the up and down. (or vice versa)
Remember the image is not confined to the Watch face it can move off of and onto the Watch face
Samsung Developer Relations
Well, that is totally out of box approach for me. Never thought solving it via images. But sounds like worth trying. Such an image can hopefully be created (once geometry, font sizes etc are solved) automatically, quering the data from a DB.
edit: But wouldn’t this repositioning of the image according to each minute still require 1440 condition(al line)s … ? “If minute x, then position xy”. Or just somehow “start from pos 1, after each minute scroll down 450px, at 0000 start from pos 1”? Well, I guess I have to do my own research from here, but if somebody would give further advice to the newbie, I’d appreciate it a lot.
You will move the image grid the hour number times the grid pitch width and the minute multiplied by the grid pitch height. Obviously you will have to think about the grid with this in mind.
Ron Always provides good advice here. Inspired I would say.
Thanks a lot, russellcresser and Ron! Much appreciated!!
@OttS . Please post a display shot or a WIP shot when you get there .
I have now followed your advice (although modified it) and progressing well with my 1440 minutes project. It’s a “history clock”, where each hour+minute corresponds to the respective year. As I write this, we are in XII century …
Seems working. I did not do one big sheet, instead I’m trying with png-s (transparent, containing only respective minute’s text) for each individual minute. So far so good. Let’s see how this impacts battery life …
Please see a couple of screenshots. It’s in Estonian language, but you get the idea …
X and Y are settings
so the image position would be 10 + ([HOUR] *12)
and Y position something like 20 + ([MIN] *6)
Are you going to Invent some History for after Eight Twenty Three. I am sorry but even if your images are Small that is quite a load on your watch . I see you are more than Half Way through . Have you sent it to your watch as it is ? Keep us informed of your progress .
Thanks a lot again, Ron! I get the theoretical idea, but to actually implement it is a bit beyond my knowledge yet.
Besides — would it give a better result battery load wise? I mean one PNG file where all the pictures of 1440 minutes are combined is probably at least as big as individual PNG’s summed. Currently my PNG’s are in average 20KB, so all 1440 of them would be 28.8MB. Would one combined file be possibly less than that?
Secondly — would it be easier on the battery to compute each minute the new position of this big PNG file, than to just load a new small PNG?
I’m afraid the 30MB watch face will at the end of the day be not a viable option, but I’m experimenting a little bit more. Intuitively it seems it should be done via querying text strings from a database, and wrapping the text in the text box, plus ofc adjusting font sizes. But that looks like a new programming course for me.
Thanks anyway and if you kindly share some more tips and suggestions, they’d all be very much appreciated!
After 2023 there are luckily other options than to invent history. Some events are predicted, like “radio signal x sent in year x reaches its destination at a distant star y”. Or “US economy reaches zero net emission”, or “Germany shuts down its last NPP” (obviously these are not as sure things as the radio signal thing). But mostly it’s anniversaries, like “Harvard Uni x years”, “y years from the event x”, “David Hasselhof 400!” etc.
As I responded to Ron, my png-s for each minute are in average 20KB, but that would anyway result in 28.8MB APK at least. Intuitively too much, I’m afraid. But let’s see.
I have not made it half way through yet. I have so far made just three hours of minute-PNG’s and am currently monitoring what the battery impact is. If you would like to try it, you can download the zipped WFS file in the below post. Currently the actual “event PNG’s” are hours 0-1, 9-10 and 16-17, so if you try it, these are the hours to look for. So 3 full hours, so altogether 180 PNG’s. And the APK is 5.2MB. If you try it and care to share some feedback, I’d appreciate it a lot!
I believe it is customary to post a Zipped version of your
.wfs file here for sharing . I will happily look at that on the Studio .
Sorry, @russellcresser , my bad, didn’t know the traditions here. I have uploaded the zipped wfs file and updated the above link respectively.
No Bad . I am new here . We are both Learners .
Just post the zip file here . IT always worries me when I have to go to a Third Party To Download something .
Shame you can not use a text box .
You Have a lot of work in front of you .
Here’s the zip. Again — learning the manners here.
20230109 PNGd.zip (3.3 MB)
We are all Learning and doing our best to be Polite .
Such an interesting idea OttS, best of luck with your project!
I just wanted to weigh in regarding the size of the watch face.
The size itself (30MB in this case) shouldn’t matter significantly in terms of battery life, apart from taking a bit longer to download and install.
I’ve created a watch face that’s about 30MB in size, so large because of an animation that lasts 60 seconds.
On average, battery life with this watch face is perhaps 5% shorter than with other watch faces, maybe even less than that, so not at all a huge difference. Performance-wise there isn’t any notable difference.
The animation itself doesn’t run in the background, so any additional battery drain happens only while the watch screen is active and needs to refresh at 15 fps.
In your case what could matter, in terms of battery and performance, is having those additional background tasks activating every minute - a whole 1440 of them.
However, I’m honestly not sure how much of an impact that would be in practice. It could be significant, but on the other hand it’s only one additional task per minute, so if the images are well optimized (compressed, and no additional resizing in WFS) it might just be okay.
Ha . @enkei_design . 60 Second animation !! . I was going to start a topic for my question . I think I know the answer . I have a sequence of 24 Images which I made for another platform where we can change the Duration of the Sequence . Are we stuck with 15 FPS ? I know I could drop some frames but I might as well make a new sequence if I can not change the Frame Rate .