Example Code for widgets

Hello together

as non professional developer it's pretty frustrating to try&error and fight with the extremely minimalistic garmin API Documentation.
Even most of the examples provided in the SDK doesn't have any introducing texts or useful comments.

can anyone provide the source code for a simple, but fully explained widget with the following features:
- A simple "Hello World", "Hallo Welt", "Bonjour le Monde" widget (multilanguage)
- with input of 2 Parameters (1 standard Numberpicker eg YEAR_OF_BIRTH and 1 custom number eg. "running shoes owned" )
- device specific output for fenix3, epix, FR920Xt, ...

- one button action (like changing background color)
- saving the actual background color to app.setdata
- comments comments comments ;-)

i can do this for watchfaces, but i'm struggling with "apps & widgets"...

Regards
  • Have you looked through the samples in the SDK? While there isn't one sample that does everything you want, there are samples for many of the things you're looking for. Also, if you create a new project in Eclipse (for a widget), it gives a basic widget with a few things already there.

    Some things you are looking for in the NumberPicker aren't in the current SDK, like custom titles on them.

    Putting stuff in the ObjectStore (there is a sample) is really up to you. For example, bg color - you could store it as a string like "green" or store it as a value like Gfx.COLOR_GREEN, and then it's up to use to use that key value in the OS to set it.