Class: $.BackgroundTimer

Inherits:
Application.AppBase show all

Overview

This app demonstrates how to use a background process. The user can start a 5 minute timer and if the app is not running when the timer expires the watch will push a notification to launch the application.

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var _backgroundData as Application.PersistableType

var _timerView as $.BackgroundTimerView or Null

Instance Method Details

getInitialView() as [ WatchUi.Views ] or [ WatchUi.Views, WatchUi.InputDelegates ]

Return the initial view for the app

Returns:

  • Array Pair [View, Delegate]

getServiceDelegate() as [ System.ServiceDelegate ]

Get service delegates to run background tasks for the app

Returns:

  • An array of service delegates to run background tasks

initialize()

Constructor

onBackgroundData(data as Application.PersistableType) as Void

Handle data passed from a background service delegate to the app

Parameters:

  • data —

    The data passed from the background process

onStart(state as Lang.Dictionary or Null) as Void

Handle app startup

Parameters:

  • state —

    Startup arguments

onStop(state as Lang.Dictionary or Null) as Void

Handle app shutdown

Parameters:

  • state —

    Shutdown arguments

onStorageChanged() as Void

Handle a storage update


Generated Jun 9, 2026, 8:45:34 AM