System API
chevron down
 

System API

isAppInstalled()

New in SDK 5.1

Checks if an app is installed given a UUID

import { isAppInstalled } from "system";

if (isAppInstalled("12345678-1234-5678-1234-567812345678")) {
   console.log('App is installed!');
} else {
   console.log('App is NOT installed!');
}

system.isAppInstalled(uuid: string)

Parameters

uuid: string

The UUID of the app to check presence of. The expected format is 12345678-1234-5678-1234-567812345678

launchApp()

New in SDK 3.0

Launches an app given a UUID

import { launchApp } from "system";

const args = { name: "Phil", number: 42, list: ["one", "two", "three"] }
launchApp("12345678-1234-5678-1234-567812345678", args);

system.launchApp(uuid: string, launchArguments?: any)

Parameters

uuid: string

The UUID of the app to launch. The expected format is 12345678-1234-5678-1234-567812345678

(optional) launchArguments: any

Arguments which are passed to the app being launched.

Variable: memory

Type: Memory

The Memory API provides information about the system's native memory usage, and the memory usage of the current application.

import { memory } from "system";
console.log("JS memory: " + memory.js.used + "/" + memory.js.total);

Interface: Memory

Memory interface.

Properties

readonly js

MemoryUsage

Memory usage details for JavaScript memory.

readonly monitor

MemoryPressureMonitor

Memory pressure monitor.

readonly native

MemoryUsage

Memory usage details for Native memory (graphics, operating system libraries, etc.)

Interface: MemoryPressureMonitor

Monitor for memory pressure events.

Properties

onmemorypressurechange

((this: MemoryPressureMonitor, event: Event) => any) or undefined

Event listener for changes in memory pressure conditions.

readonly pressure

"normal" or "high" or "critical"

Memory pressure condition.

  • "normal" means that the application's memory usage is normal.
  • "high" means that the memory usage is high, and the application should try to release some memory as soon as possible.
  • "critical" means that the application is close to running out of memory and risks being killed if some memory is not released immediately.

Interface: MemoryUsage

Memory usage details

Properties

readonly peak

number

Maximum memory used since the application was launched, in bytes.

readonly total

number

Total memory available in bytes.

readonly used

number

Current memory in use, in bytes.