View Single Post
Posts: 153 | Thanked: 159 times | Joined on Nov 2009
#17
I did a quick look at the "modern" watchface i'm using and which uses the JS api it's look quite easy.

Basically its an JS engine which supports common javascript including "XMLHttpRequest", window.navigator.geolocation.getCurrentPosition and a new Object called "Pebble"

The Pebble object supports different methods, like sendAppMessage or openURL, there are also some events fired to be listened.

openURL method for example opens the given url in a browser (QWebkit?) and the external website then can GET a special protocol url in the browser window with json data which then in return can be accessed in the JS coded via an eventlistener on the "webviewclosed" event.