Hi, is there a way from a widget to access the last (today's) activities? And is it possible to get the information from those activities which sports it was? I know how to access the last activity and it's info field but I can't find the kind of sports there.
There's no way to get the info you're looking for in Connect IQ.
As an additional note, on a F5x, based on your app type, there might not be data in Activity.Info for your last activity that's available. An example of this is when a CIQ watchface is run in it's normal mode, Activity.Info.currentLocation isn't available. A trick there is start an activity that uses GPS, then go into the widget loop with the app recording, and the watchface can get currentLocation. This is a step not needed on other watches.
If you assume that all activities have been uploaded to a web service (like Garmin Connect or Strava), you can use those services to get the data you are looking for. As an example, the Strava web API has the activities endpoint which you can use to query for activities in a given date range. Each activity has a field to indicate the activity type, just like you are looking for.
As Travis said, you might be able to get data with a background process in a watchface (pulling data from Strava was used as an example at one of the breakout sessions at the Summit.)
The only thing you'll want to keep in mind is that background processes have limited memory, so you'll want to keep the response to web requests small enough to work in the memory available
OK, thanks for that workaround. What I can do is access the latest activity (except the 5X which is somehow special) and grab the activity from there. I want to built a My Day widget. I can't show the kind of sports but I can show a generic sports icon. What I need from the latest activity is the timerTime to show and the startTime to decide whether the activity is shown or not. I get both fields from the info field.
Is there anything which will not work (except that fancy 5X behavior)?