Skip to main content
Version: 7.3.2

System

API Reference: Device.System

System is used to retrieve operating system-specific information of the device.

TypeScript
import PageSampleDesign from "generated/pages/pageSample";
import { Route, Router } from "@smartface/router";
import Application from "@smartface/native/application";
import System from "@smartface/native/device/system";

//You should create new Page from UI-Editor and extend with it.
export default class Sample extends PageSampleDesign {
constructor(private router?: Router, private route?: Route) {
super({});
}

onShow() {
super.onShow();
const { headerBar } = this;
Application.statusBar.visible = false;
headerBar.visible = false;

}

onLoad() {
super.onLoad();

console.log("Device.System.OS: " + System.OS);
console.log("Device.System.OSVersion: " + System.OSVersion);
console.log("Device.System.android.apiLevel: " + System.android.apiLevel);
console.log("Device.System.batteryLevel: " + System.batteryLevel);
console.log("Device.System.isBatteryCharged: " + System.isBatteryCharged);
console.log("Device.System.language: " + System.language);
console.log(
"Device.System.android.isApplicationInstalled: " +
System.isApplicationInstalled("io.smartface.SmartfaceApp")
);
//@ts-ignore
console.log("Device.System.vibrate(): " + System.vibrate());
console.log(
"Device.System.android.menuKeyAvaliable: " + System.android.menuKeyAvaliable
);
console.log(
"Device.System.fingerPrintAvailable: " + System.fingerPrintAvailable
);
}
}