Known direct subclasses
RemoteValue.Domain.None

None defines an unprefixed domain where variables are stored directly under their bare name without a ':' namespace prefix.

RemoteValue.Domain.System

System defines the "SYSTEM" domain for host-defined values shared across documents.

RemoteValue.Domain.User

User defines the default "USER" domain for document-specific named values.


The Domain namespaces named RemoteValue variables so document-specific, host-defined, and shared values do not collide.

Named values — created via APIs such as RemoteFloat.createNamedRemoteFloat, RemoteInt.createNamedRemoteInt, RemoteBoolean.createNamedRemoteBoolean, RemoteString.createNamedRemoteString, and RemoteColor.createNamedRemoteColor — are recorded in a remote document under <namespace>:<name> (or bare <name> for None; see prefixed). Hosts update these variables at playback without re-recording the document, and can inspect a document's declared variable names to push only the domains that document reads:

  • User ("USER"): Document-defined value supplied by the host specifically for a single document. Its meaning is only known for that document (for example, "shutter.is_open" for a card's bound device slot).

  • System ("SYSTEM"): Host-defined value whose meaning is defined for a specific host across documents, providing values such as current heart rate BPM ("SYSTEM:heart_rate_bpm").

  • Custom domains (Domain("HOME")): Shared namespaces defined for an application ecosystem so multiple documents played in the same host can read well-known shared values alongside their own User slots.

  • None (null): Unprefixed variables stored directly under their bare name without a ':' prefix.

For example, a home automation dashboard can define a "HOME" domain for home-wide values alongside per-card User device slots:

val Home = RemoteValue.Domain("HOME")

// Document-defined slot in USER ("USER:shutter.is_open"), bound per card instance:
val isShutterOpen =
RemoteBoolean.createNamedRemoteBoolean(name = "shutter.is_open", defaultValue = false)

// Shared home values in HOME ("HOME:sun.elevation", "HOME:sun.above_horizon"), meaningful
// to any card on the dashboard and defaulting to daytime when solar data is unavailable:
val sunElevation =
RemoteFloat.createNamedRemoteFloat(
name = "sun.elevation",
defaultValue = 45f,
domain = Home,
)
val isSunUp =
RemoteBoolean.createNamedRemoteBoolean(
name = "sun.above_horizon",
defaultValue = true,
domain = Home,
)

// Host-defined value in SYSTEM ("SYSTEM:heart_rate_bpm"), provided by a wearable host:
val heartRateBpm =
RemoteFloat.createNamedRemoteFloat(
name = "heart_rate_bpm",
defaultValue = 70f,
domain = RemoteValue.Domain.System,
)
Throws
IllegalArgumentException

if namespace is empty or contains ':'

Summary

Nested types

None defines an unprefixed domain where variables are stored directly under their bare name without a ':' namespace prefix.

System defines the "SYSTEM" domain for host-defined values shared across documents.

User defines the default "USER" domain for document-specific named values.

Public constructors

Domain(namespace: String?)
android

Public functions

open operator Boolean
equals(other: Any?)
android
open Int
android
String

Prepends this domain's namespace and ':' to name (for example, "HOME:sun.elevation"), or returns name unchanged for None.

android
open String

Returns this domain's namespace (for example, "USER", "SYSTEM", or "HOME"), or "" for None.

android

Public constructors

Domain

Domain(namespace: String?)
Parameters
namespace: String?

non-empty domain identifier without ':' characters (for example, "HOME"), or null for an unprefixed domain equivalent to None

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

prefixed

fun prefixed(name: String): String

Prepends this domain's namespace and ':' to name (for example, "HOME:sun.elevation"), or returns name unchanged for None.

Parameters
name: String

variable name within this domain

Returns
String

qualified variable name stored in the remote document

toString

open fun toString(): String

Returns this domain's namespace (for example, "USER", "SYSTEM", or "HOME"), or "" for None.

Returns
String

the domain namespace string, or "" if unprefixed