Upload
pebble-technology
View
271
Download
0
Embed Size (px)
DESCRIPTION
Thomas Sarlandie, Head Developer Evangelist at Pebble, welcomes everyone to the second ever Developer Retreat and goes through a detailed agenda of the next 4 days including some interesting facts about Pebble development over the past year. Also featured: New stuff in 2.6 - Background Workers Coming up in 2.7 - Wakeup API Day 1 - Video 2
Citation preview
TITLE TEXT
PEBBLE DEVELOPER RETREAT 2014 KICK-OFF
THOMAS - DEVELOPER EVANGELIST @SARFATA
WELCOME!
100DEVELOPERS
COUNTRIES 14
4000+ APPS
6 MILLION APP DOWNLOADS
!
!
100+ MILLION HOURS
MOST USERS ENGAGE WITH 3 OR MORE APPS PER WEEK
15% OF USERS HAVE TRIED MORE THAN 20 APPS
THANK YOU!
PEBBLE IS NOW AVAILABLE IN !
US,UK,CA,BE,NE,LU,DK,NO,SW
AND THE REST OF THE WORLD!
WHAT DIFFERENCE A YEAR MAKE …
ONE YEAR OF FIRMWARE
2.1 2.2 2.3 2.4 2.5 2.6
SepFeb
2.0
May June July
User Improvements
Compass …Doc Improvements PebbleKit Improvements
Emoji
PEBBLE FIRMWARE 2.6 WAS RELEASED THIS WEEK
ONE YEAR OF FIRMWARE
2.1 2.2 2.3 2.4 2.5 2.6
SepFeb
2.0
May June July
Battery life
PebbleKit JS Connectivity
+10% Battery Life
+50% Time Connected
AND MORE …
2.72.1 2.2 2.3 2.4 2.5 2.6
SepFeb
2.0
May June July
WakeUp
AGENDA
Introducing the new APIs !
Developer Retreat 2014 Activities !
Logistics for this week
AGENDA
NEW APIS
FRAMEBUFFER ACCESS
Directly manipulate the frame buffer Overlay the frame buffer with UI elements !
GBitmap* graphics_capture_frame_buffer(GContext* ctx);
FRAME BUFFER API
Details later today in our Graphics talk
BACKGROUND API
Build Activity Trackers A separate executable in your app Only one Worker running on Pebble !
Limited to 12kB of RAM Limited set of APIs !
Can both exchange messages Background app can launch the foreground app
INTRODUCING THE BACKGROUND WORKER API
Foreground App
Background Worker
PBW
"## appinfo.json"## resources"## src$ &## bgexample.c"## worker_src$ &## worker.c&## wscript
USING BACKGROUND WORKER
The new Pebble build script will automatically look for worker files in the worker_src folder. !
On CloudPebble, you can select to add a file to the foreground app or background worker. !
Worker must #include <pebble_worker.h>!
You can also use pebble new-project --worker
The foreground process can launch the background worker !
!
!
Check the return value for errors.
STARTING THE BACKGROUND WORKER
AppWorkerResult result = app_worker_launch();
Starting an activity tracker while another one is running will cause the system to show a confirmation popup !
When the interrupting tracker is stopped, the previous one is automatically restarted
ONE BACKGROUND WORKER AT A TIME
Your application can query the state of its background worker !
bool running = app_worker_is_running();!
And of course stop it !
app_worker_kill();
POLLING FOR YOUR BACKGROUND WORKER
Background worker and foreground app can communicate via a new dedicated channel AppWorkerMessage: bool app_worker_message_subscribe(AppWorkerMessageHandler handler);typedef void (*AppWorkerMessageHandler) (uint16_t type, AppWorkerMessage *data);void app_worker_send_message(uint8_t type, AppWorkerMessage *data);!
This channel can be used to synchronize status information, current stats, user actions, etc. AppWorkerMessage is limited to 3 bytes. Use Persistent Storage to exchange more data.
COMMUNICATING WITH BACKGROUND WORKER
Background worker do not have access to AppMessage and PebbleKit JS. They do have access to Persistent Storage and Data Logging, !
Possible strategies: 1. Continuously transfer data to a mobile app via Data Logging 2. Save data to Persistent Storage, Start the foreground app to push data via AppMessage and JavaScript
COMMUNICATING WITH THE PHONE
Designed and optimized for Activity Trackers !
Only one running at a time !
Compatible with DataLogging or PebbleKit JS (via Persistent Storage)
BACKGROUND WORKERS
WAKE UP API
Coming Soon!
Background Worker is great for activity tracker … But what about Timers, Alarms, Game Alerts? !
The Wake Up API lets your app request a Wake Up call.
WAKE UP!
Your application can set a time in the future where it wants to be awoken: !
WakeupID app_wakeup_schedule(time_t timestamp, int32_t reason, bool notify);
HOW TO REQUEST A WAKE UP CALL?
If your application is not running, it will be started. You can figure out why via a new AppLaunchReason API: !
AppLaunchReason app_launch_reason(void);!
typedef enum { APP_LAUNCH_SYSTEM = 0, //!< App launched by the system APP_LAUNCH_USER, //!< App launched by user selection APP_LAUNCH_PHONE, //!< App launched by mobile or companion app APP_LAUNCH_WAKEUP //!< App launched by wakeup event} AppLaunchReason;!
bool app_wakeup_get_launch_event(WakeupID *id, int32_t *reason);
HOW TO RECEIVE A WAKE UP CALL
If your application is running, you will receive an event. Just like all event services, you need to register a handler first: !
typedef void (*WakeupHandler)(WakeupID wakeup_id, int32_t reason);void app_wakeup_service_subscribe(WakeupHandler handler);
HOW TO RECEIVE A WAKE UP CALL
The system will refuse to schedule a WakeUp event with less than 60 seconds margin to other WakeUp events. Use the return value to re-schedule if needed. !
If the watch is off, the WakeUp event will be missed but you can notify the user via the notify parameter. !
Each app can only schedule up to 8 events.
SNOOZE
The WakeUp API is included in FW 2.7-beta1 distributed today to all developer retreat attendees and to all registered Pebble developers who request access to it.
USING THE WAKE UP API TODAY
ACTIVITIES
Thursday Friday Saturday Sunday
Kickoff
Graphics
Battery Workshop
Cod
e Re
view
Hacking and Robots
Hacking
Meetup in SF
Strap
Pebble Dev Awards
Size
1010000
Bluetooth LE Workshop
Computer History Museum
Cod
e Re
view
Cod
e Re
viewCloudPebble
Overlay
Pebble™
ADVANCED PEBBLE PROGRAMMING
1pm to 4pm
Heiko and Matthew will share our most advanced techniques and best tips! !
Size Graphics 1010000
SAN FRANCISCO MEETUP
Learn what really impacts battery life !
Find out how much battery your application is really using on user wrists !
Discover best practices to save battery
BATTERY WORKSHOP
10:30 to 11:00
This is what happens when we let our engineers loose !
Martijn will distribute an experimental (!) firmware with support for a BLE API and we will share a bunch of BLE-enabled gadgets. !
The rest is up to you …
BLUETOOTH LOW ENERGY
11:00 to 11:30
Work with one of our engineer to improve your code, reduce the size of your apps, battery usage, speed of your graphics, etc!
CODE REVIEWS
Discover CloudPebble new features !
Tell us what you would like to see in CloudPebble
CLOUDPEBBLE WORKSHOP
14:30 to 15:00
STRAP PRESENTATION
15:00 to 15:30
Have you ever struggled with the 24k limit? !
Ron and Grégoire will show you how to split your code in several pieces that will be dynamically loaded from the resources. !
This is also a great presentation to learn more about Pebble memory system and the SDK build tools.
USING RESOURCE SPACE FOR CODE
15:30 to 16:00
The name Pebble is becoming more and more popular, especially among apps. As we keep on growing we will need to change the rules regarding how you can use our name. !
Join the developer evangelism team and the legal team to discuss how we should roll this out.
USE OF THE “PEBBLE” BRAND
16:00 to 16:30
COMPUTER HISTORY MUSEUM
PEBBLE BOTS
Credit: https://www.youtube.com/watch?v=2ibwZYR2oKg
On Sunday morning, Cherie will give awards to notable members of the developer community.
PEBBLE AWARDS
Thursday Friday Saturday Sunday
Kickoff
Graphics
Battery Workshop
Cod
e Re
view
Hacking and Robots
Hacking
Meetup in SF
Strap
Pebble Dev Awards
Size
1010000
Bluetooth LE Workshop
Computer History Museum
Cod
e Re
view
Cod
e Re
viewCloudPebble
Overlay
Pebble™
LOGISTICS
We would like to hear all your feedbacks. There are no subjects that are taboo. Please share all ideas and suggestions.
FEEDBACK THIS YEAR
Appstore APIs flexibilityPaid apps
Phone2Watch Communication
PebbleKit JS
Mobile apps
Pebble.js
8 Apps limit?UI / Design
Firmware APIsConfig view
Answering Notifications?
iOS Android
Promotion
HardwareAccessoriesBands
Customization
Communication
LOOKING FOR A JOB?
DEVELOPER RETREAT EXCLUSIVE CONTENT
ENJOY!
1pm to 4pm
Heiko and Matt
ADVANCED PEBBLE PROGRAMMING