Data from a web service in a datafield, or access to a widget from an activity app

Former Member
Former Member
Hi,

I have written a widget (and an unpublished app) that gets some data from a web service using makeJsonResuest() which is part of the Communications module. I have a couple of people asking whether it is possible to include the key number in a data field. This is so that they can show their blood sugar in something like the run app.

So how do I do this?

Please don't answer "Communications module is not available in datafields to conserve battery", I know that.

I am pretty sure that it is not possible to pass data between widgets and data fields or between applications, but if anyone knows of a way to do this, please say how.

The current behaviour of my widget is open, make a call to the web service, display the data, close (because auto closing is what Garmin make my Vivoactive do for widgets)

Based on the assumptions
There is no conventional approach to be taken to get data from my web service into a data field
That I would be a wasting my time developing a run app of my own that accesses the data.
That updating the data from my web service will have a drain on the battery but my users will accept the cost for the benefit.

Does anyone have any ideas on how to solve the problem.

I have the following ideas on ingredients to a possible solution and want to know whether any are viable:
1. Create a timer in my widget that keeps it alive and refreshing periodically so that I can keep fetching the data. I only need to make a call every five minutes, as that is the frequency at which data is updated. I think that this is a prerequisite for updating a data field.
2. Keep my widget running whilst an app is running. It seems as though the step counter runs on my Vivoactive still functions and it looks like a widget.
3. Create my own activityinfo entry or some other system type field that I can write data to if from my widget so that a datafield can use it?
4. Update an existing activity info attribute that I have chosen to hijack such as swolf, because my users won't be swimming
5. Add my widget to the pool that is available when running another app, so that a user can at least switch to it whilst exercising.
6 Override the standard garmin exercise apps so that I can leave them fully functional but have the extra bonus of being able to add my own custom code
7. Create an add in so that the standard apps can include a widget or sub-app similar to the inclusion of custom data fields.
8. Push data from my api to the watch using an app that sends a notification that feeds a data field.

I fully expect the answers to be "No, but nice try".

I whilst I am thinking of useful things, do you think that it is possible to read a json file from and android phone running garmin connect mobile? If you can that would mean that I might be able to run the app in "camping mode" and provide data without an internet connection. But that is another issue.

It would be great if Garmin could allow communications in data fields and just provide a warning of the impact on battery life. If I choose to do something silly like find out what my blood sugar is whilst exercising I will take the battery life hit. I suspect that app stores self govern and therefore if people write data fields that cause poor performance on users watches don't have their apps downloaded and get poor reviews, so allowing it would make it better for developers. Oh yes, and watch faces too?

Any thoughts on how to get data from a webservice into a data field or another app would be much appreciated.

Thanks,
R.
  • No but nice try.

    All widgets will time out.
    The Objext store is not shared.

    Only thing I believe u can do is... Run app... Access the clock. Switch to widget. Go back to run app
  • Former Member
    Former Member over 9 years ago
    switching to watch

    No but nice try.

    All widgets will time out.
    The Objext store is not shared.

    Only thing I believe u can do is... Run app... Access the clock. Switch to widget. Go back to run app


    Hi Nikeow,

    Thanks for the reply. Does the app continue running when you look at the watch? And I noticed that only Garmin widgets are available. Is there a magic and undocumented setting that we can use to put our widgets in the inner circle?

    R
  • Former Member
    Former Member over 9 years ago
    Any ideas

    Any ideas Garmin team?
  • Former Member
    Former Member over 9 years ago
    The only way to feed external data into a Data Field right now is through the Generic ANT channel.

    You could do this with ConnectIQ if you want to go to the (a bit outlandish) lengths of using a second ConnectIQ device as a ANT bridge. The second device could run an APP that reads the data and uses the Generic ANT channel to broadcast it, and the primary device could receive it in a data field.
  • Former Member
    Former Member over 9 years ago
    Thanks

    The only way to feed external data into a Data Field right now is through the Generic ANT channel.

    You could do this with ConnectIQ if you want to go to the (a bit outlandish) lengths of using a second ConnectIQ device as a ANT bridge. The second device could run an APP that reads the data and uses the Generic ANT channel to broadcast it, and the primary device could receive it in a data field.


    Brian, Thanks for the reply. That is outlandish, so I will wait until Garmin allow data fields to use Communications. Any idea when that will be?

    R.
  • Former Member
    Former Member over 9 years ago
    As far as I know, it is not planned.
  • Former Member
    Former Member over 9 years ago
    Such a shame

    As far as I know, it is not planned.


    Thank you for the reply, Brian.

    That is a shame, because that's where the magic will lie in your platform. Yes, you'll have to carry a phone in your jersey pocket, but many people do for safety or music. It will open up things like being able to see Strava segment data in the standard run or cycle apps, or seeing the wind direction or weather changing when out for a ride with that Accuweather data app. Or, as I want to, knowing your blood sugar level on your cycle computer/watch, whilst out for a ride or a run. That is truly magic.

    The fact that ConnectiQ exists is why I own a Garmin watch, and not one of your competitors.

    Don't worry about replying.

    R.
  • which is why - u can go implement / write your own app and have most of the things youare referring to within it. Like me. I made my own run app to suit me. I can integrate the blood sugar thing you're referring to as well into the app I believe.

    Oh. Ya. My app is on the store.
  • Former Member
    Former Member over 9 years ago
    Writing a run app or configuring Garmin 's

    which is why - u can go implement / write your own app and have most of the things youare referring to within it. Like me. I made my own run app to suit me. I can integrate the blood sugar thing you're referring to as well into the app I believe.

    Oh. Ya. My app is on the store.


    Thanks Nikeow,
    My challenge to that is:
    Isn't it better use of master developers' time to not have you all writing duplicate code to display speed, cadence, heart rate, laptimes etc etc?

    What could you have done with the extra time?

    That is the benefit of data fields, we accept the good work of Garmin and add value. Their app store may grow faster which is good for them, and they will be less likely to pull the plug on it, which is good for us.

    Is your code open source? ;)

    R.
  • I tend to view this differently.
    As opposed to the likes of Suunto where you place some plugins and/or write simple codes for it, by providing a blank canvas (so to speak) there are more and much better ways to paint and it also frees you from the shackles of what is thought to be the "right way to do it"

    Look at Apple IOS and the JailBreak Scene. How many of those unique and creative features have now gotten integrated into the final product.
    The world is your oyster, it's up to you to go pick it (if you choose to)