The Other WatchKitAlexsander Akers · @a2NSLondon · 25/09/14
Availableearly 2015
Availableearly 2015
Apple madewatches cool.
Remember this?
xkcd 1420 "Watches" by Randall Munroe.
Let’s get ticking!
I can haz SDK?Local
$ brew install pebble-sdk
http://developer.getpebble.com/sdk/
Online
CloudPebble http://cloudpebble.net
Project Creation$ pebble new-project --javascript NSLondon$ tree NSLondon.├── appinfo.json├── resources├── src│ ├── NSLondon.c│ └── js│ └── pebble-js-app.js└── wscript
Project AnatomyNSLondon.c
#include <pebble.h>
static Window *window;
Project AnatomyNSLondon.c
static void init(void) { window = window_create(); window_stack_push(window, true);}
static void deinit(void) { window_destroy(window);}
Project AnatomyNSLondon.c
int main(void) { init(); app_event_loop(); deinit();}
Components• Window ≈ UIViewController
• WindowStack ≈ UINavigationController
• Layer ≈ UIView
ComponentsWindow
As we saw before, window_create() and window_destroy() are used for window creation and destruction.
You get access to the root layer with window_get_root_layer().
ComponentsWindowStack
Push with window_stack_push().Pop with window_stack_pop().
ComponentsActionBarLayer
Components(Rot)BitmapLayer
GCompOp
ComponentsScrollLayer
ComponentsSimpleMenuLayer
ComponentsMenuLayer
ComponentsTextLayer
ComponentsInverterLayer
Other UI features• Vibration
• Backlight
• Click handling
• Animations
Graphics• Circles
• Rects
• Rounded rects
• Paths
• Fills & strokes
• Text drawing/sizing
AppMessageTalk with JS / SDK
TimersCall function after delay
StorageThe poor man's NSUserDefaults
Event ServicesAccelerometer
Event ServicesApp Focus
Event ServicesBattery
Event ServicesBluetooth Connection
Event ServicesCompass / Magnetometer
Event ServicesTick Timer
The Other WatchKitAlexsander Akers · @a2NSLondon · 25/09/14
Top Related