docs/EXAMPLES

Nebble Examples

Nebble provides two complementary sets of examples:

Ported Examples (Pebble SDK Examples in Nim)

Official Pebble SDK examples ported to demonstrate how Nebble's high-level API maps to C code. Perfect for developers migrating from C or wanting C-SDK parity.

Repository: ported-examples

ExampleTypeKey Features
simple_analogWatchfaceGPath, custom drawing, trigonometry, responsive layout
ks_clock_faceWatchfaceCustom AnimationImplementation, UnobstructedArea (Quick View), animations
classio_battery_connectionWatchfaceBattery events, Bluetooth status, FixedString formatting
time_dotsWatchfaceRadial graphics, custom layer drawing, platform-adaptive colors
feature_persist_counterAppPersistent storage, ActionBarLayer, click handling
feature_accel_discsAppAccelerometer physics, collision detection, round display support
feature_custom_fontAppCustom fonts (GFontRef), resource loading, ARC-managed handles
feature_image_transparentAppGBitmap, BitmapLayer, compositing modes, transparency
pdc_imageAppPDC vector graphics, GDrawCommandImage, resource centering
content_indicator_demoAppScrollLayer, ContentIndicator configuration, managed handles

Nebble Native Examples

Examples written in idiomatic Nim, demonstrating Nebble-specific features and patterns not present in C Pebble development.

Repository: nebble-examples

ExampleTypeKey Features
hello_worldAppDeclarative nebbleApp DSL, text layers, click handlers
animation_demoAppPropertyAnimation, event-driven sequences, animation handlers
comms_demoAppFull-stack Nim with phone-side PKJS logic, typed AppMessage
health_watchfaceWatchfaceHealth service integration, activity metrics, background data
glance_menu_demoAppAppGlance API, dynamic menu callbacks, timeline integration
menu_demoAppSimpleMenuLayer, sections, selection handling, item callbacks
vibes_demoAppVibes API, vibration patterns, haptic feedback

Running Examples

To build and run an example:

  1. Clone the examples repository:

    git clone https://github.com/Brokezawa/ported-examples    # For C SDK parity
    git clone https://github.com/Brokezawa/nebble-examples     # For Nebble native

  2. Navigate to the example directory:

    cd ported-examples/simple_analog  # or nebble-examples/hello_world

  3. Build for all platforms:

    nebble build

  4. Install to the emulator:

    nebble install --emulator basalt

Learning from Examples