Skip to main content

Device

Complete API reference for Device, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Platform

Component: no


public class Device

Static Methods

SignatureReturnsDescription
getBatteryPercentage()intReturns the device's battery percentage.
availableProcessors()intReturns the number of available processors on the device.
openURL(String)voidOpens the specified URL in the default web browser.
openLink(String)voidOpens the specified link in the default web browser.
vibrateOneShot(long)voidVibrates the device for the specified duration (in milliseconds).
vibratePattern(long[], int)voidMakes the device vibrate following the time durations (in milliseconds) defined in the array, alternating between vibration and pause (starting with a pause). After completing the array, the repetition begins at the specified index (-1 to not repeat).
stopVibrate()voidStops any ongoing vibration on the device.
setMouseVisible(boolean)voidSets the visibility of the mouse cursor on the device.
setClipboard(String)voidCopies the given text to the device's clipboard.
getClipboard()StringReturns the text in the device's clipboard.