Module: Toybox.Application

Overview

The Application module contains the base class for every Connect IQ app.

The Application Module includes the AppBase class which is responsible for controlling the app life cycle. This module also includes set and get methods to control the settings and properties values held in the Object Store and a GOAL_TYPE enum that defines the different goal types that can be triggered.

See Also:

Since:

API Level 1.0.0

Modules Under Namespace

Modules: Properties, Storage

Classes Under Namespace

Classes: AppBase, AudioContentProviderApp, ObjectStoreAccessException

Constant Summary

GoalType

Name Value Since Description
GOAL_TYPE_STEPS 0

API Level 1.3.0

GOAL_TYPE_FLOORS_CLIMBED 1

API Level 1.3.0

GOAL_TYPE_ACTIVE_MINUTES 2

API Level 1.3.0

Typedef Summary

typedef PersistableType as PropertyValueType

typedef PropertyKeyType as Number or Float or Long or Double or String or Boolean or Char

typedef PropertyValueType as PropertyKeyType or Array<PropertyValueType> or Dictionary<PropertyKeyType, PropertyValueType> or BitmapResource or Null

typedef ResourceReferenceType as BitmapReference or FontReference

typedef ResourceType as Array or Dictionary or String or AnimationResource or BitmapResource or FontResource

Instance Method Summary collapse

Instance Method Details

getApp() as AppBase

Retrieve the AppBase Object that is currently running.

Returns:

  • AppBase

    The currently running AppBase object

Since:

API Level 1.0.0

loadResource(resource as Symbol) as ResourceType or ResourceReferenceType

Load a resource from the executable.

Note:

FontReference, BitmapReference is only supported in CIQ 4.0.0 or later.

Parameters:

  • resource(Symbol)

    An identifier for a resource defined in the project's resources.xml file

Example:

Loading a String resource

// The resources.xml file contents:
// <resources>
//     <string id="AppName">APEELingApp</string>
// </resources>
using Toybox.Application;

var banana = Application.loadResource(Rez.Strings.AppName);

Returns:

Since:

API Level 3.1.0


Generated Apr 22, 2021 10:10:31 AM