Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The Other WatchKit 
Alexsander Akers · @a2 
NSLondon · 25/09/14
Available 
early 2015
Available 
early 2015
Apple made 
watches 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://cloudpeb...
Project Creation 
$ pebble new-project --javascript NSLondon 
$ tree NSLondon 
. 
├── appinfo.json 
├── resources 
├── src...
Project Anatomy 
NSLondon.c 
#include <pebble.h> 
static Window *window;
Project Anatomy 
NSLondon.c 
static void init(void) { 
window = window_create(); 
window_stack_push(window, true); 
} 
sta...
Project Anatomy 
NSLondon.c 
int main(void) { 
init(); 
app_event_loop(); 
deinit(); 
}
Components 
• Window ≈ UIViewController 
• WindowStack ≈ UINavigationController 
• Layer ≈ UIView
Components 
Window 
As we saw before, window_create() and window_destroy() 
are used for window creation and destruction. ...
Components 
WindowStack 
Push with window_stack_push(). 
Pop with window_stack_pop().
Components 
ActionBarLayer
Components 
(Rot)BitmapLayer
GCompOp
Components 
ScrollLayer
Components 
SimpleMenuLayer
Components 
MenuLayer
Components 
TextLayer
Components 
InverterLayer
Other UI features 
• Vibration 
• Backlight 
• Click handling 
• Animations
Graphics 
• Circles 
• Rects 
• Rounded rects 
• Paths 
• Fills & strokes 
• Text drawing/sizing
AppMessage 
Talk with JS / SDK
Timers 
Call function after delay
Storage 
The poor man's NSUserDefaults
Event Services 
Accelerometer
Event Services 
App Focus
Event Services 
Battery
Event Services 
Bluetooth Connection
Event Services 
Compass / Magnetometer
Event Services 
Tick Timer
The Other WatchKit 
Alexsander Akers · @a2 
NSLondon · 25/09/14
The Other WatchKit
Upcoming SlideShare
Loading in …5
×

The Other WatchKit

1,031 views

Published on

A WatchKit you can use right now!

Published in: Technology
  • Be the first to comment

  • Be the first to like this

The Other WatchKit

  1. 1. The Other WatchKit Alexsander Akers · @a2 NSLondon · 25/09/14
  2. 2. Available early 2015
  3. 3. Available early 2015
  4. 4. Apple made watches cool.
  5. 5. Remember this? xkcd 1420 "Watches" by Randall Munroe.
  6. 6. Let’s get ticking!
  7. 7. I can haz SDK? Local $ brew install pebble-sdk http://developer.getpebble.com/sdk/ Online CloudPebble http://cloudpebble.net
  8. 8. Project Creation $ pebble new-project --javascript NSLondon $ tree NSLondon . ├── appinfo.json ├── resources ├── src │ ├── NSLondon.c │ └── js │ └── pebble-js-app.js └── wscript
  9. 9. Project Anatomy NSLondon.c #include <pebble.h> static Window *window;
  10. 10. Project Anatomy NSLondon.c static void init(void) { window = window_create(); window_stack_push(window, true); } static void deinit(void) { window_destroy(window); }
  11. 11. Project Anatomy NSLondon.c int main(void) { init(); app_event_loop(); deinit(); }
  12. 12. Components • Window ≈ UIViewController • WindowStack ≈ UINavigationController • Layer ≈ UIView
  13. 13. Components Window 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().
  14. 14. Components WindowStack Push with window_stack_push(). Pop with window_stack_pop().
  15. 15. Components ActionBarLayer
  16. 16. Components (Rot)BitmapLayer
  17. 17. GCompOp
  18. 18. Components ScrollLayer
  19. 19. Components SimpleMenuLayer
  20. 20. Components MenuLayer
  21. 21. Components TextLayer
  22. 22. Components InverterLayer
  23. 23. Other UI features • Vibration • Backlight • Click handling • Animations
  24. 24. Graphics • Circles • Rects • Rounded rects • Paths • Fills & strokes • Text drawing/sizing
  25. 25. AppMessage Talk with JS / SDK
  26. 26. Timers Call function after delay
  27. 27. Storage The poor man's NSUserDefaults
  28. 28. Event Services Accelerometer
  29. 29. Event Services App Focus
  30. 30. Event Services Battery
  31. 31. Event Services Bluetooth Connection
  32. 32. Event Services Compass / Magnetometer
  33. 33. Event Services Tick Timer
  34. 34. The Other WatchKit Alexsander Akers · @a2 NSLondon · 25/09/14

×