Useful links
- USB Garmin on GNU/Linux
- onPartialUpdate
- eBook
- User interface Programmers Guide
- My question
- My second question
Lifecycles
Objects tend to be temporary, so be careful about storing things in member variables.
For example, for a watch face, the AppBase
and WatchFace
objects will get destroyed whenever the watch face goes out of sight and recreated when it comes back.
You can save data in AppBase
’s onStop
method (or as soon as you get it).
The approach that I found works for a watch face that gets data from the internet:
- Have a
ServiceDelegate
that will run in the background and fetch data.- It’s returned by
AppBase.getServiceDelegate
. - It calls
Background.exit(data)
when the network call returns.
- It’s returned by
- Have a
WatchFace
with a method likesetData
.- It’s returned by
AppBase.getInitialView
.
- It’s returned by
- Have
AppBase
that:- Calls
Background.requestTemporalEvent
ingetInitialView
to trigger the first request. - Calls
Background.requestTemporalEvent
inonBackgroundData
for subsequent requests. - Stores the result of
onBackgroundData
inApplication.Storage
. - Passes the result of
onBackgroundData
to theWatchFace
if it currently exists. - In
getInitialView
, callWatchFace.setData
if we have a result stored inApplication.Storage
.
- Calls
Graphics
Reference (src):
Fonts:
Graphics.FONT_XTINY
Graphics.FONT_TINY Graphics.FONT_NUMBER_MILD
Graphics.FONT_SMALL Graphics.FONT_NUMBER_MEDIUM
Graphics.FONT_MEDIUM Graphics.FONT_NUMBER_HOT
Graphics.FONT_LARGE Graphics.FONT_NUMBER_THAI_HOT
You can also add _SYSTEM
after FONT
.
Colours:
Graphics.WHITE Graphics.COLOR_LT_GRAY
Graphics.COLOR_DK_GRAY Graphics.COLOR_BLACK
Graphics.COLOR_RED Graphics.COLOR_DK_RED
Graphics.COLOR_YELLOW Graphics.COLOR_ORANGE
Graphics.COLOR_GREEN Graphics.COLOR_DK_GREEN
Graphics.COLOR_BLUE Graphics.COLOR_DK_BLUE
Graphics.COLOR_PINK Graphics.COLOR_PURPLE
Graphics.COLOR_TRANSPARENT
GIMP palette for the colours a Garmin watch can display.
Installation
To get the Garmin SDK’s simulator running on Manjaro Linux:
- Try running
bin/simulator
to see what’s missing. sudo pacman -S libpng12
- Install webkitgtk2
The available colours for devices that support 16 bits can be found by searching for COLOR_
here.
Or just here.
Installing GPSBabel got my device to mount.