personal watch-app that I'd like to be a watch-face

Former Member
Former Member
I developed a simple watch-app with date, time, BT status, battery level and (this is the part that prevents it from being a watch-face) weather + my company stock price which I fetch from the internet using makeWebRequest().

To use it, I have to load it from the IQ APP menu.
I'd much prefer it were a regular watch-face `cause then, I'd be able to run thru the carousel of steps, weather, calendar, notifications ..
Is there someway to convince my forerunner it's a watch-face.
I don't plan to publish the app; it's for personal use only so, I'm hoping that battery-life constraints don't apply (which garmin may have for watch-faces in the connect store).

Thanks.

  • Nope.. Since you're doing comm, it's got to be either a watch-app or widget.

    But......
    When you say you want to show various things, do you have a timer in your code? For example, a timer that fires every minute, and using that, update the display (Ui.RequestUpdate() ),and change what's displayed?

    You could also have the timer fire every second and show seconds
  • Former Member
    Former Member over 8 years ago
    I have a timer that fires every 10 secs.
    I call reqUpdate() in the handler.
    In that same handler, I fire the weather request (every 15 mins) and stock request (every 15 mins but, 30 secs after the weather request to stagger them).

    Can I leverage that somehow?
  • Ok, a couple things I'll suggest:

    First have your timer fire every minute. You don't really need it every 10 seconds, and you app is doing a bit more than it needed.

    The second thing I'd do, is in onReceive() for the weather, I'd do the request for the stock data. You know the weather is done, so you can get the stock data any time after that (which could be less than your 30 second delay and you don't need separate intervals)

    Also, if you do this, at the end of the "onReceive()" for both weather and stock data, call Ui.requestUpdate(), as that way, the screen will update with the new data right away, and not wait for the next time the timer fires.

    Something else. Let's say you decide that you want a new stock price every 5 minutes, but weather, every 15 minutes is fine ..Then every 3rd time that onReceive() for the stock is called, you do the request for weather.

    You may do this already, but there's really no sense in getting the stock info when the market is closed as it uses your cell data plan. You could add a simple check for day of the week and times, and see if you can just skip the stock data request. (display the last data you have or just say "Market Closed"). You'd still be doing the call on weekday holidays when the Market is closed, but knowing that would make this really complex! :)
  • Former Member
    Former Member over 8 years ago
    Appreciate the suggestions jim_m_58. :)

    Re: "First have your timer fire every minute" - I update the current time when the timer fires. If I were to bump up the granularity of the timer to 1 min, I'd be, worse case, ~1 min off the real time. e.g. it's 1:23:59 when the timer fires. I'll display 1:23 'til the next timer event. It'll be 1:24 in 1 sec so, I'll be off the right time for ~1 min.
    Re: "The second thing I'd do, is in onReceive() for the weather, I'd do the request for the stock data." - I tried that but, my app crashes if I don't stagger the makewebrequest() calls. I posted a thread in this forum with the details a week ago. You + Travis are on that thread.
    Re: "but there's really no sense in getting the stock info when the market is closed" - clever!! I don't consider the time when fetching stock info but, that's an optimization I can look into.

    The suggestions though don't help with my core issue.
    I want the garmin watch-app to be treated as a watch-face (specifically, so I can scroll thru my watch-app, steps, weather, notifications ...)
    Again, for personal use and I don't care that the watch-app (watch-face wannabee) isn't power efficient.
    I'm coming from pebble-land where watch-faces have web access (via javascript).

    Is it possible to move the web calls into widgets and then have the "watch-face" reference the widgets?
    Probably clear from this question that I don't know the 1st thing about widgets. :)
  • I want the garmin watch-app to be treated as a watch-face (specifically, so I can scroll thru my watch-app, steps, weather, notifications ...)

    You can't. Applications of type watch-app can't be installed as watch faces, and those of type watchface don't have access to communications.

    Is it possible to move the web calls into widgets and then have the "watch-face" reference the widgets?

    No. Applications (regardless of type) have no access to the state of other applications on the device. The watch-app and widget application type can use the intents feature to send data to another watch-app or widget, but that is all that we have access to.

    Travis
  • For the timer thing and min:59, you are already in the state where you could be 10 seconds late on a minute change. Firing the timer every second would make it correct, or with a 1 min timer, when you first start it, have it set for the number of seconds needed to fire once at the top of the minute, and then go into a repeating timer for each minute when it fires. So if it's at 45 seconds, set a timer to fire once after 15 seconds, and then repeat each minute after that.
  • Former Member
    Former Member over 8 years ago
    Thanks Travis. I haven't started looking thru the docs to learn about widgets but, from the default widgets on my FR230, I assume widgets can accept user input + do comms? So, I could support on-demand stock lookups that way, yes?

    Thanks Jim. Excellent suggestion that optimizes for both power & accuracy. :)
  • Yes, widgets can do comm and accept input, but not everything on the man view - for example, up/down will move you through the widget loop, and isn't seen in the widget

    for my weather widget, I'll fire up GPS is I need the location, then use that location to get the weather from the internet for example. Or the user can press "start" to fire up GPS to get the current location, and then the weather for the new location.

    The thing about widgets is they have a timeout, where they will return to the watchface (the length of the timeout varies by device, and some, like the Edge, don't have a timeout at all)
  • Thanks Jim. Excellent suggestion that optimizes for both power & accuracy. :)


    I second this.

    While this may seem limiting, Garmin's approach is to use purpose built widgets to deliver things like weather and news. Widgets are a great way of accessing data without having to bake it all into a watchface, or waste time launching an app.
  • yes, widgets by design, are meant to be "quick views" of things, and on watches, easy to access in the widget loop from the watchface. And they can also do many of the things you can't do with a watchface, like GPS, comm, access sensors, etc. They do come in handy!