API Reference

App

Get device and app info, set clipboard, relaunch the app, and manage device-level settings. Favorite-folder mutations are documented under the Files section.

Type Definitions

bash
type App {
  usbConnected: Boolean!
  urlToken: String!              # current session token
  httpPort: Int!
  httpsPort: Int!
  appDir: String!
  deviceName: String!
  battery: Int!                  # battery level 0–100
  appVersion: Int!               # versionCode
  osVersion: Int!                # Android SDK level e.g. 35
  channel: String!               # "github" | "google"
  permissions: [String!]!        # granted API permissions
  audios: [PlaylistAudio!]!      # current playlist
  audioMode: MediaPlayMode!      # REPEAT | REPEAT_ONE | SHUFFLE
  audioCurrent: String!          # path of the playing track
  sdcardPath: String!
  usbDiskPaths: [String!]!
  internalStoragePath: String!
  downloadsDir: String!
  developerMode: Boolean!
  favoriteFolders: [FavoriteFolder!]!
}

type FavoriteFolder {
  rootPath: String!
  fullPath: String!
  alias: String              # optional display alias, nullable
}

type TempValue {
  key: String!
  value: String!
}

type DeviceInfo {
  # Hardware + OS info: manufacturer, model, sdkInt, buildChannel, etc.
  # Fields are platform-dependent; see PlainApp source for the full list.
}

type Battery {
  level: Int!                # 0–100
  status: BatteryStatus!     # CHARGING | DISCHARGING | FULL | NOT_CHARGING
  health: BatteryHealth!
  plugged: BatteryPlugged!
  temperature: Int!          # tenths of a degree Celsius
  voltage: Int!              # millivolts
}

enum BatteryStatus   { CHARGING DISCHARGING FULL NOT_CHARGING UNKNOWN }
enum BatteryHealth   { GOOD OVERHEAT DEAD OVER_VOLTAGE UNSPECIFIED_FAILURE UNKNOWN COLD }
enum BatteryPlugged  { AC USB WIRELESS NONE }

Operations

query

app

Get all device and app state in a single query.

bash
query GetApp {
  app {
    usbConnected urlToken httpPort httpsPort appDir deviceName
    battery appVersion osVersion channel permissions
    audios { title path duration } audioMode audioCurrent
    sdcardPath usbDiskPaths internalStoragePath downloadsDir developerMode
    favoriteFolders { rootPath fullPath alias }
  }
}
query

deviceInfo

Get hardware and OS info (manufacturer, model, SDK level, etc.).

bash
query GetDeviceInfo {
  deviceInfo { manufacturer model sdkInt buildChannel }
}
query

battery

Get current battery level, charging status, health, and voltage.

bash
query GetBattery {
  battery { level status health plugged temperature voltage }
}
mutation

setTempValue

Set a temporary key/value pair in server memory. Cleared when the HTTP server restarts.

bash
mutation SetTempValue($key: String!, $value: String!) {
  setTempValue(key: $key, value: $value) { key value }
}
mutation

relaunchApp

Restart the PlainApp process on the device.

bash
mutation RelaunchApp {
  relaunchApp
}
mutation

openAccessibilitySettings

Open the Android Accessibility settings screen on the device. Required before sendScreenMirrorControl can dispatch gestures.

bash
mutation OpenAccessibilitySettings {
  openAccessibilitySettings
}
mutation

openWebSettings

Open the PlainApp web-UI settings screen on the device (password, 2FA, etc.).

bash
mutation OpenWebSettings {
  openWebSettings
}
mutation

setClip

Set the device clipboard to the given text.

bash
mutation SetClip($text: String!) {
  setClip(text: $text)
}
mutation

updateDeviceName

Change the device display name shown in the web UI and broadcast to paired peers.

bash
mutation UpdateDeviceName($name: String!) {
  updateDeviceName(name: $name)
}