This FireMonkey template shows the new Android Kiosk Mode introduced in Android 6.0 with Embarcadero Delphi. The Kiosk mode (lock mode) is a special application mode. You cannot exit these applications.
The purpose of this template is
- Demonstration of launching applications in Kiosk Mode;
- Make a simple, understandable mechanism for implementing the operation of the mode in any application.
All implementation of the mode is in the KioskApplication.pas module
- StartLockTask (AOtherAppPackages: TArrayOfStrings = ) – starts Kiosk Mode. AOtherAppPackages – accepts an array of strings, package names of external applications that need access from your application.
- Example: StartLockTask ([‘com.android.settings’]);
- StopLockTask – turns off Kiosk Mode;
- CleanOwnerState – Clears the status of the application as the current owner of the device.
Create an instance of the TKioskApplication class and call StartLockTask after the application starts. It is also necessary to make a condition for exiting the application (for example, entering a password). Before closing the application, call StopLockTask.
You can get this FireMonkey template from GetIt Package Manager