This is a brief introduction to hacking the Pebble smart watch with iOS.
We cover the difference between Watch Face and Watch Apps, then how to send messages to and from the Pebble and your iPhone.
3. SPECIFICATION
•Pebble OS, modified FreeRTOS
•Cortex-M3 ARM microprocessor
•1024KB Flash Memory
•RAM between 64KB and 128KB
•1.26” screen -144 x 168 pixels
•Black and white “transflective LCD” (ePaper)
10. WHAT CAN IT DO?
•Display SMS
•Display Caller ID
•Accept/Reject Calls
Demo Time
11. WATCHFACES VS APPS
What is the difference?
A standard app:
• Generally has the system status bar at the top of the display—showing the time.
(Although apps can also be made “fullscreen” which removes the status bar.)
• May update the display more frequently than a watch face.
• Can respond to button presses.
A watch face app:
• Is displayed full screen without the system status bar.
• Usually uses the minute or second handlers.
• Is expected to be very careful with its use of system resources (e.g. power, display
updates) in order to preserve battery life.
• Can be made a “default” that is automatically displayed when the launcher menu
times out.
12. KEY CONCEPTS
•Event Handlers
•Tick Handler
•Input Handler
•Resources
•Types
•Fonts
•Bitmaps
•Data
•Build process converts
•On-screen Layers
•Object/Layer hierarchy
•Layers are drawn on
•Higher-level layers
•TextLayer
•BmpContainer
resources into useable a format
13. ANATOMY OF AN APP
There are certain things all Pebble
watchapps need to have
Headers
Meta Data
14. ANATOMY OF AN APP
There are certain things all Pebble
watchapps need to have
Window
Handler +
Event Loop
18. PREREQUISITES
•Python
Pebble relies heavily on Python based scripts
•ARM toolchain
Compile applications for the ARM architecture
http://developer.getpebble.com/1/GettingStarted/MacOS/
20. PHONE/APP COMMS
•Bi-directional Communication
•Communication over Bluetooth
•SDK abstracts communications (somewhat)
•APIs for pushing messages called AppMessage
•AppSync is a layer on top of AppMessage
•iOS has a Communication Session
•Single session for all 3rd party apps
•Only opened from iOS
•Last one in wins
•Close the session when you are done
-closeSession:
21. RECEIVING MESSAGES
•Define Inbound Buffer
•Messages are all dictionaries
•Size calculation
•1 + (n * 7) + D1 + ... + Dn
•n = number of tuples
•Dx sizes of the values
•Define Handlers
•in_received
•in_dropped
22. IOS (FINALLY)
Required Frameworks
Additional Configuration
•Add the value "com.getpebble.public" to the "Supported external
accessory protocols" (UISupportedExternalAccessoryProtocols)
array in your app's Info.plist
•Optionally, add the value "App communicates with an accessory"
(external-accessory) to the "Required background modes"
(UIBackgroundModes) array in your app's Info.plist
23. HANDLING THE PEBBLE
•Setup a delegate for Pebble Central
•Get the last connected watch
•Attempt to connect to the watch
•Handle connection and disconnection events
•Use the connected watch to send/receive
messages
Demo Time
24. MADE FOR IPHONE
Pebble participate in the Made for iPhone program.
To submit your app to the App Store
Pebble need to whitelist your application.
Once you have an App completed, email Pebble
bizdev@getpebble.com