Class EDTLibrary

Object
EDTLibrary

public class EDTLibrary
extends Object
The CASIO Enterprise Developer Tools Main Library

This Class holds all static methods required for a Developer to easily access methods and properties of the device where system access rights are required.

Since:
1.00
API Note:
The EDT Library is bound to the calling application on application startup time automatically.
The Library's lifecycle therefore depends on the application lifecycle.
Due to the Lifecycle of Android Applications and the underlying timing, it is strongly advised not to call any Library Methods inside the onCreate method.
When the activity is being launched (and hence the process gets created), the same applies to the onStart and onResume methods.
If you need to call any Library methods at application start in one of the above mentioned methods, you should use the Callback Mechanism offered by the onLibraryReady method instead.
For instance, instead of calling EDTLibrary.reboot() directly in onCreate, use this code to postpone it to a Callback appropriately:
ScannerLibrary.onLibraryReady(new LibraryCallback() {
     public void onLibraryReady() {
         EDTLibrary.reboot();
     }
 });

Which can be simplified to:
EDTLibrary.onLibraryReady(() -> { EDTLibrary.reboot(); });

Or even further to:
EDTLibrary.onLibraryReady(EDTLibrary::reboot);
  • Method Summary

    Modifier and Type Method Description
    static boolean addNetwork​(WifiConfiguration wifiConfiguration)
    Add a new network description to the set of configured networks.
    static boolean allowUnknownSources​(boolean allow)
    Specifies whether applications from "unknown sources" (not from Google Play) can be installed on the device
    static boolean clearCacheForPackage​(String packageName)
    Clears the Cache of an Application given by it's package name.
    static boolean clearClipboard()
    Clears the device's Clipboard
    static boolean clearDataForPackage​(String packageName)
    Clears the Data of an Application given by it's package name.
    static boolean clearPassword()
    Clears the device password (PIN)
    static boolean connectNetwork​(String ssid)
    Connects to an existing network according to it's SSID.
    static boolean connectNetworkId​(int networkId)
    Connects to an existing network according to it's networkId.
    static Path copyFile​(Path sourceFilePath, Path destinationFilePath, CopyOption... options)
    Copies a file from one location to another, with a variable number of StandardCopyOptions and/or LinkOptions applied
    static boolean createNewApn​(APN apn, boolean setAsDefault)
    Creates a new Access Point Name (APN) configuration for a carrier data connection and optionally sets it as the new default configuration.
    static boolean deleteFile​(String filePath)
    Removes the specified file
    static boolean enableAdb​(boolean enable)
    Enable / disables the ADB connectivity via USB
    static boolean enableApplication​(String packageName, boolean enable)
    Enables / Disables a System Application given by it's package name.
    static boolean enableBackgroundData​(boolean enable)
    Specifies whether or not Background Data use is permitted
    static boolean enableBatteryOptimization​(String packageName, boolean enable)
    Enables / Disables a Battery Optimization ("Doze Mode") for an Application given by it's package name.
    This adds/removes the given application to/from the system's whitelist of Apps which are not subject of battery optimization.
    static boolean enableBluetooth​(boolean enabled)
    Enables/Disables Bluetooth on demand
    static boolean enableCameras​(boolean enable)
    Specifies whether or not the Device Cameras can be used
    static boolean enableClipboard​(boolean enable)
    Enable / disables the Clipboard
    static boolean enableDeveloperMode​(boolean enabled)
    Enables/Disables Developer Mode on demand
    static boolean enableDeviceAdmin​(String packageName, String className, boolean makeAdmin)
    Enables/Disables Device Admin Mode for specific apps/packages on demand
    static boolean enableGps​(boolean enabled)
    Enables/Disables GPS on demand
    static boolean enableMassStorage​(boolean enable)
    Enable / disables the "USB Mass Storage" aka "File Transfer" mode
    static boolean enableNfc​(boolean enabled)
    Enables/Disables NFC on demand
    static boolean enableRoaming​(boolean enable)
    Specifies whether or not Data Roaming is available
    static boolean enableWifi​(boolean enabled)
    Enables/Disables Wifi on demand
    static boolean enableWwan​(boolean enabled)
    Enables/Disables WWAN (3G/LTE/...) on demand
    static boolean factoryReset​(boolean removeAccounts)
    Performs a factory reset of the device
    static APN[] getAllApnList()
    Gets the Array of existing Access Point Name (APN) configurations.
    static APN getApn​(String name)
    Gets the Access Point Name (APN) configuration for a carrier data connection by it's name.
    static int getApnId​(String name)
    Gets the id field of an existing Access Point Name (APN) configuration for a carrier data connection.
    static boolean getCurrentAndSetNewScanSettings​(String settingsFilePath)
    Reads current Barcode Scanner settings and applies new Barcode Scanner settings to/from files according to the specified file path
    static boolean getCurrentScanSettings​(String settingsFilePath)
    Write current Barcode Scanner Settings to file
    static Account[] getGoogleAccounts()
    Get an Array of existing Google Accounts currently configured for this device.
    static List<String> getKeyboardNames()
    Gets a List of Names of available Keyboards on this device.
    static boolean initializeKeyStore​(String storeName, String password)
    Initialize the given Certificate KeyStore with the given Password.
    static boolean installApk​(String apkFilename, boolean update)
    Installs an app by it's apk file name.
    static boolean installCertificate​(String friendlyName, String fileName)
    Installs a Certificate from a File.
    static boolean isMethodSupported​(String methodName)
    Check whether the Method indicated by the String methodName parameter is supported on the currently active device
    static boolean isMethodSupported​(BigInteger method)
    Check whether the Method indicated by the BigInteger method parameter is supported on the currently active device
    static boolean lockDevice()
    Locks the Device (i.e. device needs to be unlocked to be used further on)
    static boolean mountSDCard​(boolean mount)
    Mounts/Unmounts the external SD Card
    static Path moveFile​(Path sourceFilePath, Path destinationFilePath, CopyOption... options)
    Moves a file from one location to another, with a variable number of StandardCopyOptions applied
    static void onLibraryReady​(LibraryCallback callback)
    Add a new Callback to the Queue of Callbacks to be processed once the EDT Service becomes available
    static boolean readFile​(ReadWriteFileParams readWriteFileParams)
    Reads Data from a File
    static boolean reboot()
    Performs a device reboot
    static boolean recovery()
    Performs a device reboot into recovery mode
    static boolean rememberPasswords​(boolean enable)
    Specifies whether or not the Browser may remember Login Passwords
    static boolean removeAccount​(Account account)
    Removes (attempts to remove) a certain account from the device
    static boolean removeAllAccounts()
    Removes (attempts to remove) all configured accounts of all kind from the device
    static boolean removeAllGoogleAccounts()
    Removes (attempts to remove) all configured Google accounts from the device
    static boolean removeNetwork​(String ssid)
    Removes an existing network according to it's SSID.
    static boolean removeNetworkId​(int networkId)
    Removes an existing network according to it's networkId.
    static boolean resetPassword​(String newPassword)
    Resets the device password (PIN) to a new value
    static boolean saveFormData​(boolean enable)
    Specifies whether or not the Browser may save Form Input Data
    static boolean setDateTime​(Date date)
    Sets a new Device Date and Time
    static boolean setDefaultHomePage​(String homePage)
    Sets the default Browser Homepage
    static boolean setDefaultLauncher​(String packageName)
    Specifies a new Default Launcher
    static boolean setKeyboard​(String keyboardName)
    Sets the default and current Keyboard on this device.
    static boolean setNewScanSettings​(String settingsFilePath)
    Apply new Barcode Scanner Settings from file.
    static boolean setPreferredApn​(String name)
    Sets a new preferred Access Point Name (APN) configuration for a carrier data connections.
    static boolean setScreenLockTimeout​(int milliseconds)
    Specifies a new Screen Lock Timeout in Milliseconds
    static boolean setTimeZone​(TimeZone timeZone)
    Sets a new Device Time Zone from a specified android.icu.util.TimeZone
    static boolean setTimeZone​(String timeZoneID)
    Sets a new Device Time Zone from a specified TimeZone ID
    static boolean setTimeZone​(TimeZone timeZone)
    Sets a new Device Time Zone from a specified java.util.TimeZone
    static boolean shutdown()
    Performs a device shutdown
    static boolean testMessage​(String message)
    Displays a Toast Message containing the specified String.
    static boolean uninstallPackage​(String packageName)
    Uninstalls an app by it's package name.
    static boolean updateApn​(APN apn)
    Updates an existing Access Point Name (APN) configuration for a carrier data connection.
    static boolean updateNetwork​(WifiConfiguration wifiConfiguration)
    Update an existing network description of the set of configured networks.
    static boolean verifyApn​(String name)
    Updates an existing Access Point Name (APN) configuration for a carrier data connection.
    static boolean writeFile​(ReadWriteFileParams readWriteFileParams)
    Writes Data to a File
  • Method Details

    • isMethodSupported

      public static boolean isMethodSupported​(BigInteger method) throws IllegalStateException
      Check whether the Method indicated by the BigInteger method parameter is supported on the currently active device
      Parameters:
      method - BigInteger: Constant referencing the method to be checked
      Returns:
      boolean: true if the method is supported on the currently active device, otherwise false
      Throws:
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
    • isMethodSupported

      public static boolean isMethodSupported​(String methodName) throws IllegalStateException
      Check whether the Method indicated by the String methodName parameter is supported on the currently active device
      Parameters:
      methodName - String: Name of the method to be checked
      Returns:
      boolean: true if the method is supported on the currently active device, otherwise false
      Throws:
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
    • addNetwork

      public static boolean addNetwork​(WifiConfiguration wifiConfiguration) throws RemoteException, UnsupportedOperationException
      Add a new network description to the set of configured networks. The networkId field of the supplied configuration object is ignored.
      Parameters:
      wifiConfiguration - WifiConfiguration: The set of variables that describe the configuration, contained in a WifiConfiguration object
      Returns:
      boolean whether or not the new network could be added
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • allowUnknownSources

      public static boolean allowUnknownSources​(boolean allow) throws RemoteException, UnsupportedOperationException
      Specifies whether applications from "unknown sources" (not from Google Play) can be installed on the device
      Parameters:
      allow - boolean: true allows unknown sources, false disallows them
      Returns:
      boolean whether or not the Setting could be applied
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • clearCacheForPackage

      public static boolean clearCacheForPackage​(String packageName) throws RemoteException, UnsupportedOperationException
      Clears the Cache of an Application given by it's package name.
      Parameters:
      packageName - String: Package Name of the App which's cache shall be cleared.
      Returns:
      boolean whether or not the app cache could be cleared successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • clearClipboard

      public static boolean clearClipboard() throws RemoteException, UnsupportedOperationException
      Clears the device's Clipboard
      Returns:
      boolean whether or not the Clipboard could be cleared
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • clearDataForPackage

      public static boolean clearDataForPackage​(String packageName) throws RemoteException, UnsupportedOperationException
      Clears the Data of an Application given by it's package name.
      Parameters:
      packageName - String: Package Name of the App which's data shall be cleared.
      Returns:
      boolean whether or not the app data could be cleared successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • clearPassword

      public static boolean clearPassword() throws RemoteException, UnsupportedOperationException
      Clears the device password (PIN)
      Returns:
      boolean whether or not the Password could be cleared
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • connectNetwork

      public static boolean connectNetwork​(String ssid) throws RemoteException, UnsupportedOperationException
      Connects to an existing network according to it's SSID.
      Parameters:
      ssid - String: The SSID of the network to connect to
      Returns:
      boolean whether or not the connection could be established
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • connectNetworkId

      public static boolean connectNetworkId​(int networkId) throws RemoteException, UnsupportedOperationException
      Connects to an existing network according to it's networkId.
      Parameters:
      networkId - int: The networkId of the network to connect to
      Returns:
      boolean whether or not the connection could be established
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • copyFile

      public static Path copyFile​(Path sourceFilePath, Path destinationFilePath, CopyOption... options) throws RemoteException, UnsupportedOperationException
      Copies a file from one location to another, with a variable number of StandardCopyOptions and/or LinkOptions applied
      Parameters:
      sourceFilePath - Path: Path to copy the file from
      destinationFilePath - Path: Path to copy the file to
      options - variable number of StandardCopyOptions and/or LinkOptions to apply
      Returns:
      Path to the target file or null if operation failed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
      API Note:
      This method follows the specification of the Android API copy method.
      It's purpose is to give user applications the ability to copy files which are out of reach for non-system apps.

      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return null.

    • createNewApn

      public static boolean createNewApn​(APN apn, boolean setAsDefault) throws RemoteException, UnsupportedOperationException
      Creates a new Access Point Name (APN) configuration for a carrier data connection and optionally sets it as the new default configuration.
      Parameters:
      apn - APN: The Access Point Name (APN) configuration for a carrier data connection.
      setAsDefault - boolean: Whether or not the APN configuration should become the new default configuration.
      Returns:
      boolean whether or not the new Access Point Name (APN) configuration has been created successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • deleteFile

      public static boolean deleteFile​(String filePath) throws RemoteException, UnsupportedOperationException
      Removes the specified file
      Parameters:
      filePath - String: Path (including name) of the file to be removed
      Returns:
      boolean whether or not the file has been removed successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return false.
    • enableAdb

      public static boolean enableAdb​(boolean enable) throws RemoteException, UnsupportedOperationException
      Enable / disables the ADB connectivity via USB
      Parameters:
      enable - boolean: true enables ADB connectivity via USB, false disables it
      Returns:
      boolean whether or not the ADB connectivity via USB was enabled/disabled successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableApplication

      public static boolean enableApplication​(String packageName, boolean enable) throws RemoteException, UnsupportedOperationException
      Enables / Disables a System Application given by it's package name.
      Parameters:
      packageName - String: Package Name of the System App which shall be enabled/disabled.
      enable - boolean: True enables the System App, false disables it.
      Returns:
      boolean whether or not the app could be enabled/disabled successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableBackgroundData

      public static boolean enableBackgroundData​(boolean enable) throws RemoteException, UnsupportedOperationException
      Specifies whether or not Background Data use is permitted
      Parameters:
      enable - boolean: true enables Background Data, false disables it
      Returns:
      boolean whether or not the setting was applied successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableBatteryOptimization

      public static boolean enableBatteryOptimization​(String packageName, boolean enable) throws RemoteException, UnsupportedOperationException
      Enables / Disables a Battery Optimization ("Doze Mode") for an Application given by it's package name.
      This adds/removes the given application to/from the system's whitelist of Apps which are not subject of battery optimization.
      Parameters:
      packageName - String: Package Name of the System App which shall be added/removed to/from the doze mode whitelist.
      enable - boolean: True adds the app to the doze mode whitelist, false removes it from the doze mode whitelist.
      Returns:
      boolean whether or not the app could be added/removed to/from the doze mode whitelist successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableBluetooth

      public static boolean enableBluetooth​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables Bluetooth on demand

      If the requested state equals the current state of Bluetooth, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables Bluetooth, false disables it
      Returns:
      boolean whether or not Bluetooth could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableCameras

      public static boolean enableCameras​(boolean enable) throws RemoteException, UnsupportedOperationException
      Specifies whether or not the Device Cameras can be used
      Parameters:
      enable - boolean: true enables the Camera usage, false disables it
      Returns:
      boolean whether or not the setting was applied successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableClipboard

      public static boolean enableClipboard​(boolean enable) throws RemoteException, UnsupportedOperationException
      Enable / disables the Clipboard
      Parameters:
      enable - boolean: true enables the Clipboard, false disables it
      Returns:
      boolean whether or not the Clipboard was enabled/disabled successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableDeveloperMode

      public static boolean enableDeveloperMode​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables Developer Mode on demand

      If the requested state equals the current state of Developer Mode, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables Developer Mode, false disables it
      Returns:
      boolean whether or not Developer Mode could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableDeviceAdmin

      public static boolean enableDeviceAdmin​(String packageName, String className, boolean makeAdmin) throws RemoteException, UnsupportedOperationException
      Enables/Disables Device Admin Mode for specific apps/packages on demand

      Note that you must know both the package name of the app you want to enable/disable device admin mode upon, as well as the Class within that application that implements the DeviceAdminReceiver.
      This is not the same as the Activity class name required to launch the application and would likely need to be acquired from the application developer.

      Parameters:
      packageName - String: The package name of the app in question where you want to enable/disable device admin mode upon.
      className - String: The class name of the Class within that application that implements the DeviceAdminReceiver.
      makeAdmin - boolean: true enables device admin mode on the application, false disables it.
      Returns:
      boolean whether or not Device Admin Mode could be enabled/disabled on the application in question.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableGps

      public static boolean enableGps​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables GPS on demand

      If the requested state equals the current state of GPS, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables GPS, false disables it
      Returns:
      boolean whether or not GPS could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableMassStorage

      public static boolean enableMassStorage​(boolean enable) throws RemoteException, UnsupportedOperationException
      Enable / disables the "USB Mass Storage" aka "File Transfer" mode
      Parameters:
      enable - boolean: true enables the "USB Mass Storage" mode, false disables it
      Returns:
      boolean whether or not the "USB Mass Storage" mode was enabled/disabled successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableNfc

      public static boolean enableNfc​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables NFC on demand

      If the requested state equals the current state of NFC, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables NFC, false disables it
      Returns:
      boolean whether or not NFC could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableRoaming

      public static boolean enableRoaming​(boolean enable) throws RemoteException, UnsupportedOperationException
      Specifies whether or not Data Roaming is available
      Parameters:
      enable - boolean: true enables Data Roaming false disables it
      Returns:
      boolean whether or not the setting was applied successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableWifi

      public static boolean enableWifi​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables Wifi on demand

      If the requested state equals the current state of Wifi, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables Wifi, false disables it
      Returns:
      boolean whether or not Wifi could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • enableWwan

      public static boolean enableWwan​(boolean enabled) throws RemoteException, UnsupportedOperationException
      Enables/Disables WWAN (3G/LTE/...) on demand

      If the requested state equals the current state of WWAN, the method returns true without performing any action.

      Parameters:
      enabled - boolean: true enables WWAN, false disables it
      Returns:
      boolean whether or not WWAN could be enabled/disabled
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return false.
    • factoryReset

      public static boolean factoryReset​(boolean removeAccounts) throws RemoteException, UnsupportedOperationException
      Performs a factory reset of the device
      Parameters:
      removeAccounts - boolean: Specifies whether or not to remove all Google Accounts prior to performing the Factory Reset.
      If removeAccounts is set to "true", all Google Accounts will be removed from the device before the Factory Reset is being performed, meaning that the device will not enter FRP after performing the reset.
      If removeAccounts is set to "true" and it's not possible to remove all Google Accounts prior to performing the Factory Reset, the method will return false and the device will not perform the Factory Reset.
      This is to prevent the device from accidentally falling into FRP mode. If removeAccounts is set to "false", existing Google Accounts will remain untouched and the device will simply perform the Factory Reset. This means that if aGoogle Accounts was present at the time of calling factoryReset(false), the device will fall into FRP mode after reboot has finished.
      Returns:
      boolean whether or not the Factory Reset could be performed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      There will be no warning or any confirmation dialog whatsoever when you call this method.
      The device will simply, irrevocably, silently reboot and wipe the device.

      CAUTION: This wipes all data off the device!
      CAUTION: If there's a Google Account active on the device at factory reset time, you will need to login to that account after reboot (Google Factory Reset Protection)!

    • getAllApnList

      public static APN[] getAllApnList() throws RemoteException, UnsupportedOperationException
      Gets the Array of existing Access Point Name (APN) configurations.
      Returns:
      APN[] Array of available Access Point Name (APN) configurations.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
    • getApn

      public static APN getApn​(String name) throws RemoteException, UnsupportedOperationException
      Gets the Access Point Name (APN) configuration for a carrier data connection by it's name.
      Parameters:
      name - String: The name field of the Access Point Name (APN) configuration in question for a carrier data connection.
      Returns:
      APN the Access Point Name (APN) configuration for a carrier data connection. If no matching configuration for the name could be found, the method returns null.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
    • getApnId

      public static int getApnId​(String name) throws RemoteException, UnsupportedOperationException
      Gets the id field of an existing Access Point Name (APN) configuration for a carrier data connection.
      Parameters:
      name - String: The name field of the Access Point Name (APN) configuration in question for a carrier data connection.
      Returns:
      int the id field of an existing Access Point Name (APN) configuration for a carrier data connection. If no matching configuration for the name could be found, the method returns INVALID_APN (-1).
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
    • getCurrentAndSetNewScanSettings

      public static boolean getCurrentAndSetNewScanSettings​(String settingsFilePath) throws RemoteException, UnsupportedOperationException
      Reads current Barcode Scanner settings and applies new Barcode Scanner settings to/from files according to the specified file path

      NOTE: The Filename for the old Barcode Scanner setting will get a suffix "_old" applied.
      See getCurrentScanSettings(String settingsFilePath) and setNewScanSettings(String settingsFilePath) for further details regarding file name and file format specifications

      Parameters:
      settingsFilePath - String: Path to the file holding the Scanner settings
      Returns:
      boolean whether or not the Barcode Scanner settings could be written to (a) file(s) and the new settings could applied to the Barcode Scanner successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • getCurrentScanSettings

      public static boolean getCurrentScanSettings​(String settingsFilePath) throws RemoteException, UnsupportedOperationException
      Write current Barcode Scanner Settings to file

      NOTE: The file may or may not contain a file extension.
      If the file contains an extension (case insensitive), the generated settings file will have the following format:
      * XML if the file extension is not ".json"
      * JSON if the file extension is ".json"
      If the file contains no extension, two settings files with be created with ".xml" and ".json" extension and
      appropriate format accordingly.
      The Filename will get a suffix "_cur" applied

      Parameters:
      settingsFilePath - String: Path to the file holding the Scanner settings
      Returns:
      boolean whether or not the current Barcode Scanner settings could be written to (a) file(s) successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • getGoogleAccounts

      public static Account[] getGoogleAccounts() throws RemoteException, UnsupportedOperationException
      Get an Array of existing Google Accounts currently configured for this device.
      Returns:
      Array of Account: The Array of existing Google Accounts currently configured for this device.
      In case of failure, this method returns null.
      If no Google Accounts are configured at the time of calling this method, the return value will be an empty Array.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
    • getKeyboardNames

      public static List<String> getKeyboardNames() throws RemoteException, UnsupportedOperationException
      Gets a List of Names of available Keyboards on this device.
      Returns:
      List of String The Package Names of the available Keyboards on this device. In case of an error, the method returns null.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
    • initializeKeyStore

      public static boolean initializeKeyStore​(String storeName, String password) throws RemoteException, UnsupportedOperationException
      Initialize the given Certificate KeyStore with the given Password.
      Parameters:
      storeName - String: Friendly name of the Certificate KeyStore to be initialized.
      Can be null or an empty String, in which case the default KeyStore will be used.
      password - String: Password to be used for the KeyStore.
      Returns:
      boolean whether or not the Certificate KeyStore could be initialized successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • installApk

      public static boolean installApk​(String apkFilename, boolean update) throws RemoteException, UnsupportedOperationException
      Installs an app by it's apk file name.
      Parameters:
      apkFilename - String: File name of the .apk file to be installed.
      update - boolean: Whether or not to update the app if it's already installed.
      If you specify "true" but the app is not installed yet, this parameter will have no effect.
      If you specify "false" but the app is already installed, this method will return false and the installation will fail.
      Returns:
      boolean whether or not the .apk file could be installed successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • installCertificate

      public static boolean installCertificate​(String friendlyName, String fileName) throws RemoteException, UnsupportedOperationException
      Installs a Certificate from a File.
      Parameters:
      friendlyName - String: Friendly name of the Certificate to be installed.
      fileName - String: File Path and Name of the Certificate File.
      Returns:
      boolean whether or not the Certificate could be installed successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      2.00
    • lockDevice

      public static boolean lockDevice() throws RemoteException, UnsupportedOperationException
      Locks the Device (i.e. device needs to be unlocked to be used further on)

      May or may not turn off the display, depending on device settings

      Returns:
      boolean whether or not the Device could be locked
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • mountSDCard

      public static boolean mountSDCard​(boolean mount) throws RemoteException, UnsupportedOperationException
      Mounts/Unmounts the external SD Card
      Parameters:
      mount - boolean: true mounts the external SD card, false unmounts it
      Returns:
      boolean whether or not the external SD card could (un)mounted successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • moveFile

      public static Path moveFile​(Path sourceFilePath, Path destinationFilePath, CopyOption... options) throws RemoteException, UnsupportedOperationException
      Moves a file from one location to another, with a variable number of StandardCopyOptions applied
      Parameters:
      sourceFilePath - Path: Path to move the file from
      destinationFilePath - Path: Path to move the file to
      options - variable number of StandardCopyOptions to apply
      Returns:
      Path to the target file or null if operation failed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
      API Note:
      This method follows the specification of the Android API move method.
      It's purpose is to give user applications the ability to move files which are out of reach for non-system apps.

      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return null.

    • readFile

      public static boolean readFile​(ReadWriteFileParams readWriteFileParams) throws RemoteException, UnsupportedOperationException
      Reads Data from a File

      The readWriteFileParams parameter holds a set of parameters used to read the data from the given file.

      Since this method uses a variable set of parameters with overlapping parameter types, overloading methods or using variable argument lists isn't feasible.
      Instead, the readWriteFileParams holds a set of all required parameters for this method.

      Use ReadWriteFileParams.Builder to create a new instance of the readWriteFileParams parameter.

      The example below shows how you might create a new ReadWriteFileParams object instance for use with this method:

      
       // Create a ReadWriteFileParams object instance with a data buffer of 4K,
       // for read operation starting after 1 byte, accessing the buffer from index 2 onwards, reading a hundred bytes.
       byte[] testData = new byte[4096];
       ReadWriteFileParams readWriteFileParams = ReadWriteFileParams.setPath(Paths.get("/sdcard/Download/devinfo.html"))
             .setData(testData)
             .setFileOffset(1)
             .setDataOffset(2)
             .setLength(100)
             .setOptions(StandardOpenOption.READ)
             .build();
       EDTLib.readFile(readWriteFileParams);
       
      Parameters:
      readWriteFileParams - ReadWriteFileParams: Parameters specifying which file to read from, with optional data buffer, offsets, length and File Options.
      Returns:
      boolean whether or not the file data has been read successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
      See Also:
      ReadWriteFileParams for further details.
      API Note:
      the data buffer of readWriteFileParams is optional.
      If this method is called with a data buffer provided, the method call will fail if the data buffer is insufficient to hold the data being read.
      If this method is called without providing a data buffer i.e. when getData() equals null, the method call will dynamically allocate a buffer holding the data being read.

      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return false.

    • reboot

      public static boolean reboot() throws RemoteException, UnsupportedOperationException
      Performs a device reboot
      Returns:
      boolean whether or not the Reboot could be performed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      There will be no warning or any confirmation dialog whatsoever when you call this method.
      The device will simply, irrevocably, silently reboot, quite like when the user keeps pressing the power key and chooses to "Reboot".
    • recovery

      public static boolean recovery() throws RemoteException, UnsupportedOperationException
      Performs a device reboot into recovery mode
      Returns:
      boolean whether or not the Recovery Reboot could be performed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      There will be no warning or any confirmation dialog whatsoever when you call this method.
      The device will simply, irrevocably, silently reboot into recovery mode, quite like when the user keeps pressing the power key and chooses to "Reboot" - but using this method it will not reboot the Operating System, but reboot into recovery mode instead.
    • rememberPasswords

      public static boolean rememberPasswords​(boolean enable) throws RemoteException, UnsupportedOperationException
      Specifies whether or not the Browser may remember Login Passwords
      Parameters:
      enable - boolean: true enables remembering Login Passwords, false disables it
      Returns:
      boolean whether or not the setting was applied successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • removeAccount

      public static boolean removeAccount​(Account account) throws RemoteException, UnsupportedOperationException
      Removes (attempts to remove) a certain account from the device
      Parameters:
      account - Account: Account to be removed
      Returns:
      boolean whether or not the account removal was successful
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • removeAllAccounts

      public static boolean removeAllAccounts() throws RemoteException, UnsupportedOperationException
      Removes (attempts to remove) all configured accounts of all kind from the device
      Returns:
      boolean whether or not the account removal was successful
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      This method usually fails, because certain accounts cannot be removed.
      Those that can be removed will be removed nevertheless.
    • removeAllGoogleAccounts

      public static boolean removeAllGoogleAccounts() throws RemoteException, UnsupportedOperationException
      Removes (attempts to remove) all configured Google accounts from the device
      Returns:
      boolean whether or not the account removal was successful
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • removeNetwork

      public static boolean removeNetwork​(String ssid) throws RemoteException, UnsupportedOperationException
      Removes an existing network according to it's SSID.
      Parameters:
      ssid - String: The SSID of the network to be removed
      Returns:
      boolean whether or not the existing network could be removed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • removeNetworkId

      public static boolean removeNetworkId​(int networkId) throws RemoteException, UnsupportedOperationException
      Removes an existing network according to it's networkId.
      Parameters:
      networkId - int: The networkId of the network to be removed
      Returns:
      boolean whether or not the existing network could be removed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • resetPassword

      public static boolean resetPassword​(String newPassword) throws RemoteException, UnsupportedOperationException
      Resets the device password (PIN) to a new value
      Parameters:
      newPassword - String: The new Device Password to be set
      Returns:
      boolean whether or not the new Password could be set
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • saveFormData

      public static boolean saveFormData​(boolean enable) throws RemoteException, UnsupportedOperationException
      Specifies whether or not the Browser may save Form Input Data
      Parameters:
      enable - boolean: true enables saving Form Input Data, false disables it
      Returns:
      boolean whether or not the setting was applied successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setDateTime

      public static boolean setDateTime​(Date date) throws RemoteException, UnsupportedOperationException
      Sets a new Device Date and Time
      Parameters:
      date - Date: The Date and Time to be set
      Returns:
      boolean whether or not the new Date/Time could be set
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
      API Note:
      Requires Android N (Android 7) or later.
      If you call this method on a device running an earlier version of Android, this method will return false.
    • setDefaultHomePage

      public static boolean setDefaultHomePage​(String homePage) throws RemoteException, UnsupportedOperationException
      Sets the default Browser Homepage
      Parameters:
      homePage - String: URL of the new Homepage
      Returns:
      boolean whether or not the default Browser Homepage could be set successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setDefaultLauncher

      public static boolean setDefaultLauncher​(String packageName) throws RemoteException, UnsupportedOperationException
      Specifies a new Default Launcher
      Parameters:
      packageName - String: Package Name of the new Default Launcher
      Returns:
      boolean whether or not the Default Launcher was set successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setKeyboard

      public static boolean setKeyboard​(String keyboardName) throws RemoteException, UnsupportedOperationException
      Sets the default and current Keyboard on this device.
      Parameters:
      keyboardName - String: The Package Name of the Keyboard to be used.
      Use getKeyboardNames() to fetch a List of available Keyboard Names.
      Returns:
      boolean whether or not the Keyboard was set successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setNewScanSettings

      public static boolean setNewScanSettings​(String settingsFilePath) throws RemoteException, UnsupportedOperationException
      Apply new Barcode Scanner Settings from file.

      NOTE: The file may or may not contain a file extension.
      If the file contains an extension (case insensitive), the settings will be parsed from the following format:
      * XML if the file extension is ".xml"
      * JSON if the file extension is ".json"
      * Dynamically XML or JSON (XML is attempted first, in case of failure another attempt is made to parse JSON format) if the file extension is neither ".xml" nor ".json"
      If the file contains no extension, two settings will dynamically be parsed in XML or JSON format (XML is attempted first, in case of failure another attempt is made to parse JSON format)

      Parameters:
      settingsFilePath - String: Path to the file holding the Scanner settings
      Returns:
      boolean whether or not the new settings could applied to the Barcode Scanner
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setPreferredApn

      public static boolean setPreferredApn​(String name) throws RemoteException, UnsupportedOperationException
      Sets a new preferred Access Point Name (APN) configuration for a carrier data connections.
      Parameters:
      name - String: The name field of the Access Point Name (APN) configuration in question for becoming the new preferred carrier data connection.
      Returns:
      boolean whether or not the Access Point Name (APN) configuration in question could be set as the new preferred APN configuration.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setScreenLockTimeout

      public static boolean setScreenLockTimeout​(int milliseconds) throws RemoteException, UnsupportedOperationException
      Specifies a new Screen Lock Timeout in Milliseconds
      Parameters:
      milliseconds - int: The new Screen Lock Timeout Value in Milliseconds
      Returns:
      boolean whether or not the Screen Lock Timeout was set successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • setTimeZone

      public static boolean setTimeZone​(TimeZone timeZone) throws RemoteException, UnsupportedOperationException
      Sets a new Device Time Zone from a specified android.icu.util.TimeZone
      Parameters:
      timeZone - android.icu.util.TimeZone: The new Time Zone to be set
      Returns:
      boolean whether or not the new Time Zone could be set
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      Requires Android N (Android 7) or later.
      Devices running Android M (Android 6) or earlier should use setTimeZone(java.util.TimeZone timeZone) instead. If you call this method on a device running an earlier version of Android, this method will return false.
    • setTimeZone

      public static boolean setTimeZone​(TimeZone timeZone) throws RemoteException, UnsupportedOperationException
      Sets a new Device Time Zone from a specified java.util.TimeZone
      Parameters:
      timeZone - java.util.TimeZone: The new Time Zone to be set
      Returns:
      boolean whether or not the new Time Zone could be set
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      2.02
      API Note:
      This Method is meant to be used on devices running Requires Android M (Android 6) or earlier.
      Devices running Android N (Android 7) or later should use setTimeZone(android.icu.util.TimeZone timeZone) instead.
    • setTimeZone

      public static boolean setTimeZone​(String timeZoneID) throws RemoteException, UnsupportedOperationException
      Sets a new Device Time Zone from a specified TimeZone ID
      Parameters:
      timeZoneID - String: The ID of the new Time Zone to be set.
      Use android.icu.util.TimeZone.getAvailableIDs() or java.util.TimeZone.getAvailableIDs() to get a list of available TimeZone IDs on your device.
      Returns:
      boolean whether or not the new Time Zone could be set
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      2.02
    • shutdown

      public static boolean shutdown() throws RemoteException, UnsupportedOperationException
      Performs a device shutdown
      Returns:
      boolean whether or not the Shutdown could be performed
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
      API Note:
      There will be no warning or any confirmation dialog whatsoever when you call this method.
      The device will simply, irrevocably, silently power off, quite like when the user keeps pressing the power key and chooses to "Power off".
    • testMessage

      public static boolean testMessage​(String message) throws RemoteException, UnsupportedOperationException
      Displays a Toast Message containing the specified String.

      This method is supposed to be used for testing purpose only, for instance in order to check whether the service binding from a sample application is working or not.

      Parameters:
      message - String: The Message to be displayed
      Returns:
      boolean whether or not the Message could be shown
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • updateApn

      public static boolean updateApn​(APN apn) throws RemoteException, UnsupportedOperationException
      Updates an existing Access Point Name (APN) configuration for a carrier data connection.
      Parameters:
      apn - APN: The Access Point Name (APN) configuration for a carrier data connection, holding the new data for this configuration.
      The "id" field holds the ID of the existing APN configuration to be updated.
      Use getApnId to fetch the ID from a given name if required.
      Returns:
      boolean whether or not the new Access Point Name (APN) configuration has been applied successfully.
      If no matching configuration for the ID could be found, the method returns false.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • updateNetwork

      public static boolean updateNetwork​(WifiConfiguration wifiConfiguration) throws RemoteException, UnsupportedOperationException
      Update an existing network description of the set of configured networks. The networkId field must be set to the ID of the existing network being updated.
      Parameters:
      wifiConfiguration - WifiConfiguration: The set of variables that describe the configuration, contained in a WifiConfiguration object. It may be sparse, so that only the items that are being changed are non-null.
      Returns:
      boolean whether or not the existing network could be updated
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • uninstallPackage

      public static boolean uninstallPackage​(String packageName) throws RemoteException, UnsupportedOperationException
      Uninstalls an app by it's package name.
      Parameters:
      packageName - String: Package Name of the App to be uninstalled.
      Returns:
      boolean whether or not the app could be uninstalled successfully.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • verifyApn

      public static boolean verifyApn​(String name) throws RemoteException, UnsupportedOperationException
      Updates an existing Access Point Name (APN) configuration for a carrier data connection.
      Parameters:
      name - String: The name field of the Access Point Name (APN) configuration in question for a carrier data connection.
      Returns:
      boolean whether or not the Access Point Name (APN) configuration in question refers to a valid APN configuration.
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      Since:
      1.00
    • writeFile

      public static boolean writeFile​(ReadWriteFileParams readWriteFileParams) throws RemoteException, UnsupportedOperationException
      Writes Data to a File

      The readWriteFileParams parameter holds a set of parameters used to write the data to the given file.

      Since this method uses a variable set of parameters with overlapping parameter types, overloading methods or using variable argument lists isn't feasible.
      Instead, the readWriteFileParams holds a set of all required parameters for this method.

      Use ReadWriteFileParams.Builder to create a new instance of the readWriteFileParams parameter.

      The example below shows how you might create a new ReadWriteFileParams object instance for use with this method:

      
       // Create a ReadWriteFileParams object instance with a data buffer of 4K,
       // for write operation starting after 1 byte, accessing the buffer from index 2 onwards, writing a hundred bytes.
       byte[] testData = new byte[4096];
       ReadWriteFileParams readWriteFileParams = ReadWriteFileParams.setPath(Paths.get("/sdcard/Download/devinfo.html"))
             .setData(testData)
             .setFileOffset(1)
             .setDataOffset(2)
             .setLength(100)
             .setOptions(StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)
             .build();
       EDTLib.writeFile(readWriteFileParams);
       
      Parameters:
      readWriteFileParams - ReadWriteFileParams: Parameters specifying which file to write to, with mandatory data buffer and optional offsets, length and File Options.
      Returns:
      boolean whether or not the file data has been written successfully
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.
      IllegalStateException - Gets thrown when the Library is not ready yet to accept method calls.
      In such case, please use onLibraryReady Method to add a callback which then processes this method. See API Notes of this class for further details.
      Since:
      1.00
      See Also:
      ReadWriteFileParams for further details.
      API Note:
      the data buffer of readWriteFileParams is mandatory.
      If this method is called with a data buffer provided, the method call will fail if the data buffer is insufficient to write the specified amount of data.
      If this method is called without providing a data buffer i.e. when getData() equals null, the method call will fail.

      Requires Android O (Android 8) or later.
      If you call this method on a device running an earlier version of Android, this method will return false.

    • onLibraryReady

      public static void onLibraryReady​(LibraryCallback callback) throws RemoteException, UnsupportedOperationException
      Add a new Callback to the Queue of Callbacks to be processed once the EDT Service becomes available
      Parameters:
      callback - LibraryCallback: Instance of the LibraryCallback Interface which holds the onLibraryReady() Method which will get called once the regarding library becomes available
      Throws:
      RemoteException - Gets thrown when access to the system service fails.
      UnsupportedOperationException - Gets thrown when the current device does not support this method.