App entry point and event loop.
All interaction between a watchapp and the underlying Pebble OS is accomplished through an event loop. This should be quite similar to anyone with experience in SDL or any modern GUI library. Watchapps are responsible for subscribing to event services and implementing event handlers. Each handler receives specific types of Events dispatched throughout the life of the watchapp. app_event_loop() takes care of both waiting for new events to become available on the watchapp event bus and routing new events to the appropriate handler. EventService allows an app to directly register for different types of events. This function will block until the watchapp is ready to exit, and should be placed in the app's main() function. The following is a very simple example of how a watchapp typically configures and uses the app_event_loop():
void app_event_loop | ( | void | ) |
The event loop for apps, to be used in app's main(). Will block until the app is ready to exit.