Up until now, glances were only on the f6 and marq devices, but yesterday beta fw for the 945 and 245 with glances was released (version 4.06 on both devices)!
Up until now, glances were only on the f6 and marq devices, but yesterday beta fw for the 945 and 245 with glances was released (version 4.06 on both devices)!
Hi Jim, I just posted here: following text:
Garmin-Blake, I updated my widget battery info to support glance view. I developed it initially for a watch which supports glance view and enabled the FR945 to utilize that code. But the simulator doesn't show the glance view for the 945 (ok, i probably need to wait for an update). But the export of my widget from the development environment doesn't seems to take it into account either. I am ending up with a glance view which shows just the name of the widget...
Do I have to wait for the development environment?
My widget Time tracker lost all the data it stored with the update. This didn't happen in the past on any update. This is not nice Garmin.My other widgets work still as expected. Time tracker doesn't support glance view currently and if no data is stored by the user it may be slightly below the 32 kB limit, with data storage I am probably above this limit. May it be that for this reason data is deleted? Again, this is not nice Garmin, since I rely on this data.
I don't do anything special in my widgets for glances (glance code is in for every platform), so when I got the FW with glances, I just had to enable glance view and things worked.
The sim doesn't support glances on the 945, so maybe the next SDK will.
When you say you're close to 32k, it's really 28k,. I'd look at memory if your doing backgrounding. When onBackgroundData runs, you could have a spike when the widghet has both the current data and the data passed in onBackgroundData.
Hi Jim, my two posts above describe two different problems in two different widgets. Let's discuss the first, where I provided glance code but that doesn't shows up on the real watch. Here I am far away from the 32 kB limit, at least I am believe so. Where can I find that out? The simulator says for marq series it would consume about 40 kB, for fenix 6s it says 20 kB.
What's loaded for glance in the main application? Is it similar to backgrounding? At least getInitialView is not loaded.
As you can review in my picture the glance view shows up at least in the simulator. I enabled that beast for the fr945 but the glance view on my watch (fr945) shows just the app name. Another owner of fr945 told me that he could see it shortly but on my request to send a picture he said it's gone. I am really confused now.
As far as memory that's used in the different things, for backgrounding, it;'s stuff with the (:background) annotation. For glance view, stuff with the (:glance) annotation along with the (:background) annotation, and for the regular view, it's everything. AppBase is always loaded (it's used for backgrounding).
To check on memory in the sim, You'll see that at the bottom of the sim window when you're in glance view (3.1.6 SDK)
The difference with the marq is odd.... Are you using the (:glance) annotation? If you don't you may be loading more than you need when you're doing glances. With the widget above, I'm at 17.8kb for all sim targets with glances.
The full screen widget is a bit over 34kb
Hm, how could I utilitze that println calls on the real watch? I never did that before!!!
I double checked today again the memory consumption and it is for all watches which support glances 10 kB.
This is what my main application looks like:
using Toybox.Application as App; using Toybox.WatchUi as Ui; using Toybox.Background; var batData; var myTimer; //var theme; (:background) class BatteryInfoApp extends App.AppBase { function initialize() { AppBase.initialize(); } function getInitialView() { if(Toybox.System has :ServiceDelegate) { Background.registerForTemporalEvent(new Time.Duration(300)); } initBatData(); return [ new BatteryInfoView(), new batteryInfoDelegate()]; } function onBackgroundData(data) { initBatData(); batData.checkBgData(data); } function initBatData() { if (batData == null) { batData = new batteryData(); } } function getServiceDelegate(){ return [new BgbgServiceDelegate()]; } (:glance) function getGlanceView() { return [ new MyGlanceView() ]; } }
And this is the glance view itself:
using Toybox.WatchUi; using Toybox.Time as Date; using Toybox.Time.Gregorian as Greg; (:glance) class MyGlanceView extends WatchUi.GlanceView { function initialize() { GlanceView.initialize(); } function onUpdate(dc) { dc.setColor(Graphics.COLOR_BLACK,Graphics.COLOR_BLACK); dc.clear(); dc.setColor(Graphics.COLOR_GREEN,Graphics.COLOR_TRANSPARENT); dc.drawText(10, 0, Graphics.FONT_TINY, "Draw some text", Graphics.TEXT_JUSTIFY_LEFT); }
OK, I have just to put in a text file and then the println commands are redirected to that file?
To be honest I still believe that the overwritten view is not loaded due to outdated development environtment. I have this from the programmers help:
If widget doesn’t override AppBase.getGlanceView()
, default WatchUi.GlanceView
will be used, which simply shows the name of the Widget.
This is what I can see: the name of the Widget on my real FR945.