ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Application in "device owner" mode
  • Availability of the function
  • Running processes containing compilation errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Indicates whether the Android application is in "Device owner" mode.
An Android application in device owner mode has higher privileges than a standard application. This application can perform operations usually reserved for system applications (provided they are declared):
  • create users,
  • change global settings (Wi-Fi access, Bluetooth),
  • define security policies,
  • hide applications,
  • switch to kiosk mode and prevent the user from exiting.
    For more details, see Application in kiosk mode.
Example
// If the application is "device owner", it is switched to kiosk mode
IF InDeviceOwnerMode() THEN
KioskEnable()
END
Syntax
<Result> = InDeviceOwnerMode()
<Result>: Boolean
  • True if the application is "device owner",
  • False otherwise.
Remarks

Application in "device owner" mode

To set a WINDEV Mobile application as "device owner":
  • Check "Device management application (can become "device owner" for the kiosk mode)" in the Android project configuration description.
  • After installing the application on the desired workstation, run the following ADB command for the device on which the application is installed:
    adb shell dpm set-device-owner
    <package>/fr.pcsoft.wdjava.core.application.WDDeviceAdminReceiver
    where:
    <Package> corresponds to the package name of your Android application.
    This command creates an entry in the "/data/system/ device_owner.xml" file which references the application as "device owner".
Remarks:
  • There can only be one device owner application per device and this operation is only possible if no user has been configured on the device. Otherwise, it is necessary to delete all users before running the command.
  • Once an application has been set as "device owner", it is no longer possible to disable this mode or even delete the application. Only a factory reset can delete the application.
  • To update an application in device owner mode, it is necessary to sign it with the same key used to enable the mode.

Availability of the function

InDeviceOwnerMode can be used in all IDEs to allow for cross-platform code. Functions or procedures that use InDeviceOwnerMode can be shared between several products without generating any compilation error.

Running processes containing compilation errors

By default, the security mechanism of WLanguage is triggered only if the line containing the compilation error is run.
For example, if a function not allowed in the current product is found in a loop (IF), the security mechanism of WLanguage will be triggered only if the line containing this function is run.
Component: wd290wm.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/13/2023

Send a report | Local help