This article applies to EloView Home SDK 6.23.14. Developers are encouraged to use EloView Home SDK 6.25.520 for all new development projects and future integrations.
Click here to learn what's new in EloView Home SDK 6.25.520.
EloView Home SDK 6.23.14
Supported Platforms: Android 12 and Android 14 Elo devices including Backpack 4 (Standard/Value),I-Series 4 (Standard/Value), I-Series Standard, M50, M60 Pay, M100, and 7-Inch Pay.
Full Reference (Knowledge Base + SDK Javadoc)
APIs are organized by functional class (System, Network, Package, etc.) to simplify discovery and accelerate implementation.
Global Best Practices (from KB)
-
Always bind to the service before calling any API.
Do not invoke methods untilonServiceConnected()is received. -
Assume device policy can override local settings.
This is especially true for time, timezone, USB, kiosk mode, and application installation. -
Use NTP for time synchronization in production.
Avoid manual time configuration except for testing. -
Understand reset behavior.
-
Enterprise Reset clears Elo configuration and enrollment state.
-
Factory Reset wipes all user data and returns the device to out-of-box state.
-
-
Log the result of every API call.
This is critical for troubleshooting and escalation.
❗ Important Usage Notes
Some SDK APIs require specific Android permissions and may behave differently depending on whether the device is in EloView mode or Android Home mode. Device policy enforcement can override locally applied settings. Developers should validate device mode and permission state before invoking APIs in production applications.
The EloView Home SDK is a service-based Android SDK and requires successful service binding before any API calls can be executed. Methods may return null or no result if:
- The service is not yet connected
- The device is not in a compatible EloView state
- Policy restrictions block the operation
This guide focuses on supported and commonly used patterns. It does not enumerate every Android permission, lifecycle edge case, or internal return state documented in the raw SDK Javadoc. Standard Android service-lifecycle handling and error checking must be implemented in production applications.
Common Real-World Scenarios (from KB)
Scenario: Time zone incorrect after device enrollment
system.setNtpEnabled(true);
system.setNtpServer("time.aws.com");
system.setTimeZone("US/Central");
system.syncTimeNow();
// Verify
String tz = system.getTimeZone();
Log.d(TAG, "Timezone=" + tz);
Tip: If the timezone reverts after reboot, verify that Android automatic time zone is enabled and that device policy is not reapplying a different region.
Scenario: Safely configure single-app kiosk mode
pkg.setKioskApp("com.example.kiosk");
pkg.setKioskModeEnabled(true);
pkg.launchApp("com.example.kiosk");
Warning: Always validate an administrative escape path before enabling kiosk mode in production.
Service Binding Template (from KB)
eloView.bindService(context, callback, accessToken);
// Safe to call SDK APIs inside callback.onServiceConnected()
eloView.unbindService(context);
Important note: bindService() and unbindService() do not return values. SDK APIs must only be invoked after onServiceConnected() is called.
Core / Service Binding APIs
EloView
The EloView class provides the following operations:
- Set the content to be played on the device in EloView Control mode when the device is offline or not registered to an account using setOfflinePlayContent().
- Retrieve the type of content (APK or WebView) and the name of the content currently set in EloView Control mode using getPlayContent().
- Get the current playback status of the configured content in EloView Control mode using getPlayContentStatus().
- Check whether the device is currently connected to EloView Cloud (online or offline) using getDeviceCloudStatus().
- Toggle Wi-Fi in Elo QuickSettings and Android Home Mode using toggleWifi().
- Toggle Bluetooth in Elo QuickSettings and Android Home Mode using toggleBT().
bindService
public void bindService(android.content.Context context, ServiceConnectionCallback callback, java.lang.String accessToken)
This method binds the EloView service to the application. You must call this before invoking any EloView APIs.
Parameters
- context – Context in which the EloView APIs are used.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
unbindService
public void unbindService(android.content.Context context)
This method is used to unbind the service from the application. Use this method to unbind the service from the application when clearing resources.
Parameters
- context – Context
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unbindService(context);
Log.d(TAG, "OK: unbindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unbindService", e);
}
setOfflinePlayContent
public java.lang.String setOfflinePlayContent(java.lang.String packageName)
This method is used to set content on the device in EloView Control mode when the device is offline or not registered to an account. If the device comes online and content is set through EloView, it will override the content set through this API.
Parameters
- packageName – Package to be set as default content on the device.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setOfflinePlayContent("packageName");
Log.d(TAG, "OK: setOfflinePlayContent result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setOfflinePlayContent", e);
}
getPlayContent
public java.lang.String getPlayContent()
This method returns the type of content and name of the content set on the device. This method works only in EloView Control mode.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPlayContent();
Log.d(TAG, "OK: getPlayContent result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPlayContent", e);
}
getPlayContentStatus
public java.lang.String getPlayContentStatus()
This method returns the status of play content on the device in Control mode. The status can be one of the following strings:
YET_TO_DOWNLOAD, DOWNLOADING, DOWNLOADED, INSTALLING, INSTALLED, DOWNLOAD_FAILED, INSTALL_FAILED, UNKNOWN_STATUS
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPlayContentStatus();
Log.d(TAG, "OK: getPlayContentStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPlayContentStatus", e);
}
getDeviceCloudStatus
public java.lang.String getDeviceCloudStatus()
This method returns the device's online or offline status. The status can be one of the following strings: "Online", "Offline", "Connecting", "Reconnecting", "Online (Not Provisioned)".
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDeviceCloudStatus();
Log.d(TAG, "OK: getDeviceCloudStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDeviceCloudStatus", e);
Log.e(TAG, "FAIL: getDeviceCloudStatus", e);
}
toggleWifi
void toggleWifi(boolean isEnableWifi)
Enables or disables Wi-Fi on the device. This applies in both EloView mode and Android Home mode.
Parameters
- isEnableWifi – Boolean for enabling or disabling WiFi in QuickSettings.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.toggleWifi(true);
Log.d(TAG, "OK: toggleWifi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: toggleWifi", e);
}
switchToAndroidHomeMode
void switchToAndroidHomeMode() void switchToAndroidHomeMode(boolean isRebootNeeded, boolean isAndroidHomeMode)
This method is used to switch to Android Home mode from EloView mode. This is the same as switchToAndroidHomeMode() except that it accepts two boolean parameters. There is no way to switch back to EloView mode without a factory reset, so use with caution.
Parameters
- Switches the device from EloView mode to Android Home mode.
- If isRebootNeeded is set to true, the device will reboot to apply the mode change.
- Important note: Switching to Android Home mode may disable EloView-managed restrictions and policies.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.switchToAndroidHomeMode(true, true);
Log.d(TAG, "OK: switchToAndroidHomeMode result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: switchToAndroidHomeMode", e);
}
toggleBT
public int toggleBT(boolean isEnableBT)
This method is used to toggle Bluetooth in QuickSettings (EloView mode). It can also be used to toggle Bluetooth in Android Home mode.
Parameters
- isEnableBT – Boolean for enabling or disabling Bluetooth in QuickSettings.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.toggleBT(true);
Log.d(TAG, "OK: toggleBT result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: toggleBT", e);
}
Account APIs
AccountManager
The AccountManager class provides the following operations:
1. Provide an Authentication Token from an EloServer based on the credentials provided by the user (emailId/password or clientId/secretKey).
2. Verify whether a given Authentication Token is valid or has expired. The authentication token can either be the token obtained from the EloView server or it can be an offline JWT token provided by the Elo Support team. (The offline token is generated using the package name of your application and can only be used with the package it was generated for.)
3. All APIs require an offline token to work and will not work with an online token. The only exception is OTA APIs. OTA APIs require the online token when applying the OTA from an EloView server. For applying OTA through a custom server URL or from a local file on the device, the offline token may be used.
For example, to get an Authentication Token:
1. Using emailId and password, call getEloAccessToken. 2. Using clientId and secretKey, call getEloOAuthToken. Upon successful authentication, these methods will return a token. 3. For the offline JWT token, contact the Elo Support team.
The token retrieved from the server or support team is verified using the method verifyEloToken.
Unregister the broadcast receivers used by these AccountManager APIs using the method unregisterAccountManagerListener in the onPause and onDestroy methods of the activities in which you use these APIs to avoid leaks.
getProperty
public static java.lang.String getProperty()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getProperty();
Log.d(TAG, "OK: getProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getProperty", e);
}
setProperty
public void setProperty(java.lang.String property)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setProperty("property");
Log.d(TAG, "OK: setProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setProperty", e);
}
getClientId
public static java.lang.String getClientId()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getClientId();
Log.d(TAG, "OK: getClientId result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getClientId", e);
}
getBaseUri
public static android.net.Uri getBaseUri()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getBaseUri();
Log.d(TAG, "OK: getBaseUri result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getBaseUri", e);
}
getEloAccessToken
public void getEloAccessToken(android.content.Context context, java.lang.String userEmail, java.lang.String password, android.os.Handler handler)
This method is used to get an access token from the Elo server.
Parameters
- context – A Context object of the calling class (Activity or Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEloAccessToken(context, "userEmail", "password", handler);
Log.d(TAG, "OK: getEloAccessToken result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEloAccessToken", e);
}
configureOAuthHostedUI
public void configureOAuthHostedUI(android.app.Activity activity, android.os.Handler handler)
This method is used to initialize the OAuth Hosted UI.
Parameters
- activity – An Activity instance of the calling class.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.configureOAuthHostedUI(activity, handler);
Log.d(TAG, "OK: configureOAuthHostedUI result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: configureOAuthHostedUI", e);
}
stopOAuth
public void stopOAuth()
Call stopOAuth in the onStop() override method of the activity.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.stopOAuth();
Log.d(TAG, "OK: stopOAuth result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: stopOAuth", e);
}
destroyOAuth
public void destroyOAuth()
Call destroyOAuth in the onStop() override method of the activity.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.destroyOAuth();
Log.d(TAG, "OK: destroyOAuth result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: destroyOAuth", e);
}
logoutOAuth
public void logoutOAuth()
Call logoutOAuth to end the current login session.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.logoutOAuth();
Log.d(TAG, "OK: logoutOAuth result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: logoutOAuth", e);
}
verifyEloToken
public void verifyEloToken(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)
This function asks the Elo server to verify the given token. Upon successful verification, the handler will receive a message of type TOKEN_VERIFY_SUCCESS. Upon failure, TOKEN_VERIFY_FAIL will be received.
Parameters
- context – A Context object of the calling class (Activity or Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.verifyEloToken(context, "accessToken", handler);
Log.d(TAG, "OK: verifyEloToken result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: verifyEloToken", e);
}
getEloOAuthToken
public void getEloOAuthToken(android.content.Context context, java.lang.String clientID, java.lang.String secret, android.os.Handler handler)
This method is used to ask the EloView Portal for a new OAuth token. Upon successful authentication, a token will be sent to the device. This token is valid for use for 24 hours after it is issued. When the token expires, further attempts to verify the token and call APIs will get the TOKEN_VERIFY_FAIL response. The same is true if a token was never procured or received.
If successful, the handler will receive a message of type OAUTH_TOKEN_VALID with a JWT token as the response. Below is an example of a successful response:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJQTSJ9.eyJ1ZW1haWwiOiJwcmF0YXBlbG8rUHJvZEBnbWFpbC5jb20iLCJvdGl0bGUiOiJwcmF0YXBlbG8rUHJvZEBnbWFpbC5jb20iLCJjYXAiOnsiY3JjIjoiSDIvb2RnIiwicGVybSI6ImZmZmZmZmYwMCJ9LCJpYXQiOjE1MjUxMTc4NDgsIm5iZiI6MTUyNTExNzg0OCwiZXhwIjoxNTI1MjA0MjQ4LCJpc3MiOiIxNTAyIiwic3ViIjoiZWVhNDRkY2JkMjU5YzQyOWY4NTA3YWZhNTQyY2Q3M2YiLCJqdGkiOiJ2ZE14N1ppUGVnWT0ifQ.b2e-F1mVh0ummkBJk3m8pT2qSCceRxuS_A9GAKtYBeo"
In case of an authentication failure due to a bad clientID or secretID, the handler will receive a message of type OAUTH_TOKEN_INVALID.
Parameters
- context – A Context object of the calling class (Activity or Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEloOAuthToken(context, "clientID", "secret", handler);
Log.d(TAG, "OK: getEloOAuthToken result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEloOAuthToken", e);
}
unregisterAccountManagerListener
public void unregisterAccountManagerListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered while using any of the AccountManager APIs. Please make sure to call this in the onPause and onDestroy methods in your activity lifecycle if you made use of any of the AccountManager APIs. This ensures the receiver is not leaked.
Parameters
- context – Context in which the system APIs were used.
- context – Android context used to unregister the account manager listener.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unregisterAccountManagerListener(context);
Log.d(TAG, "OK: unregisterAccountManagerListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unregisterAccountManagerListener", e);
}
setDefaultEnvironment
public void setDefaultEnvironment(android.content.Context ctx)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDefaultEnvironment(context);
Log.d(TAG, "OK: setDefaultEnvironment result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDefaultEnvironment", e);
}
selectEnvironment
public void selectEnvironment(android.content.Context ctx, java.lang.String prop, boolean isSealed)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.selectEnvironment(context, "prop", true);
Log.d(TAG, "OK: selectEnvironment result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: selectEnvironment", e);
}
isPolarisLocked
public boolean isPolarisLocked(android.content.Context context)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isPolarisLocked(context);
Log.d(TAG, "OK: isPolarisLocked result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isPolarisLocked", e);
}
getEnvironment
public java.lang.String getEnvironment(android.content.Context ctx)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEnvironment(context);
Log.d(TAG, "OK: getEnvironment result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEnvironment", e);
}
isPolaris
public boolean isPolaris(android.content.Context context)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isPolaris(context);
Log.d(TAG, "OK: isPolaris result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isPolaris", e);
}
TokenListener
TokenListener listens for AuthenticationToken verification events and, on a valid token, provides the success response to perform further operations.
No methods are documented for this type.
System APIs
ServiceConnectionCallback
onServiceConnected
void onServiceConnected()
This method is called when the service is connected after calling bindService.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.onServiceConnected();
Log.d(TAG, "OK: onServiceConnected result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: onServiceConnected", e);
}
onServiceDisconnected
void onServiceDisconnected()
This method is called when the service is disconnected. This will not be called if the service is unbound using unbindService.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.onServiceDisconnected();
Log.d(TAG, "OK: onServiceDisconnected result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: onServiceDisconnected", e);
}
System
The System class provides the following operations:
-
Get an authentication token using
getEloAccessToken. -
Capture the device screenshot using
captureScreenShot. -
Set device orientation (portrait, landscape, reverse-portrait, reverse-landscape)
using
setOrientation. -
Get device orientation using
getOrientation. -
Factory reset the device using
factoryReset. -
Reboot the device silently using
silentReboot. -
Enable or disable the Navigation Bar using
setNavigationBarEnabled. -
Enable or disable the Status Bar using
setStatusBarEnabled. -
Grant all runtime permissions using
setGrantAllAppPermissionEnabled. -
Get Navigation Bar status using
getNavigationBarEnabled. -
Get Status Bar status using
getStatusBarEnabled. -
Get Grant All App Permission status using
getGrantAllAppPermissionEnabled. -
Set and get Backlight Timeout using
setBacklightTimeOutandgetBacklightTimeOut. -
Set and change lock screen password using
setLockScreenPasswordandchangeLockScreenPassword. -
Auto-allow USB permissions using
autoAllowUSBPermission. -
Lock or unlock secure processor firmware using
setFirmwareStatusLockEnabled. -
Set and change device PIN using
setLockScreenPinandchangeLockScreenPin. -
Enable or disable WiFi using
setWifiEnabledand get status usinggetWifiEnabled. -
Clear app cache and data using
clearAllAppCacheUserDataandclearAppCacheUserData. -
Enable ADB using
setAdbEnabledand configure custom port usingcustomPortAdb. -
Enable or disable Home button using
setHomeButtonEnabled. -
Enable or disable Power button using
setPowerButtonEnabled. -
Enable or disable Text Editor assist menu using
setTextEditorAssistMenuEnabled. -
Enable or disable volume panel “Show more” using
setVolumePanelShowMoreEnabled. -
Enable or disable Zebra barcode scanner using
setBarcodeReaderEnabled. -
Trigger barcode scan using
setScanBarcodeReaderEnabled. -
Enable or disable Elo logging using
setEloLoggingEnabled. -
Enable or disable random WiFi MAC using
setRandomWifiMacAddressEnabled. -
Enable or disable Star printer WebView access using
setStarPeripheralConnectEnabled. -
Check USB auto-allow status using
getAutoAllowUSBPermission. -
Set, remove, and query device owner using
setDeviceOwner,removeDeviceOwner, andgetDeviceOwnerStatus. -
Set and get display DPI using
setDpiandgetDpi. -
Set and get language using
setLanguageandgetLanguage. -
Set and get lock type using
setLockTypeandgetLockType. -
Enable or disable Multi Client IME using
setMultiClientImeEnabledandgetMultiClientImeEnabled. -
Set and get NTP server using
setNtpServerUrlandgetNtpServerUrl. -
Set and get NTP poll interval using
setNtpPollIntervalandgetNtpPollInterval. -
Control install permissions using
setInstallPermissionToSpecificApp,setInstallAllAppPermissionEnabled, andgetInstallPermissionToSpecificApp. -
Set and get screen size using
setScreenSizeandgetScreenSize. -
Set and get smallest pixel width using
setSmallestPixelWidthandgetSmallestPixelWidth. -
Set and get timezone using
setTimeZoneandgetTimeZone. -
Enable or disable accessibility services using
setAccessibilityService. -
Enable or disable automatic date and time using
setAutoDateTimeEnabled. -
Enable or disable Bluetooth pairing confirmation using
setBluetoothDevicePairingConfirmationEnabled. -
Set date and time using
setDateTime. -
Set display size using
setDisplaySize. -
Configure WiFi using CSV with
setEloNetworkConf. -
Set font size using
setFontSize. -
Enable or disable Idle Mode using
setIdleModeEnabled. -
Enable or disable location using
setLocationEnabled. -
Mute or unmute microphone using
setMicrophoneMuteEnabled. -
Enable or disable password visibility using
setPasswordEnabled. -
Enable or disable Play Protect using
setPlayProtect. -
Set and get reserved log space using
setReservedLogSpaceandgetReservedLogSpace. -
Set time format using
setTimeFormatEnabled. -
Enable or disable touch sounds using
setTouchSoundEnabled. -
Set volume levels using
setVolumeLevel. -
Enable or disable text selection Share menu using
setShowTextEditorShareMenuEnabled. -
Shutdown the device silently using
silentShutDown. -
Set default launcher using
setSilentDefaultLauncher. -
Get firmware lock status using
getFirmwareStatusLockEnabled. -
Upgrade secure processor firmware using
spFirmwareUpgrade. -
Start activity from foreground service using
startActivityFromForegroundService. -
Enable or disable Dark Mode using
setDarkModeEnabled. -
Wake the screen using
wakeupScreen. -
Enable or disable charging sound and vibration using
setChargingSoundAndVibrationEnabled. -
Enable or disable screen lock sound using
setScreenLockSoundEnabled. -
Enable or disable Idle Mode tile using
setIdleModeTileEnabled. -
Get and set host name using
getHostNameandsetHostName. -
Enable or disable hotspot accessibility using
setHotspotAccessibilityEnabledandgetHotspotAccessibilityEnabled. -
Get MD5 checksum using
getMD5Checksum. -
Bind and unbind the System service using
bindServiceandunbindService.
isM60Device
public static boolean isM60Device()
This method is used to get the device orientation.
Returns
Device orientation, for example portrait or landscape.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isM60Device();
Log.d(TAG, "OK: isM60Device result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isM60Device", e);
}
isM50Device
public static boolean isM50Device()
This method is used to get the device orientation.
Returns
Device orientation, for example portrait or landscape.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isM50Device();
Log.d(TAG, "OK: isM50Device result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isM50Device", e);
}
isM100Device
public static boolean isM100Device()
This method is used to get the device orientation.
Returns
Device orientation, for example portrait or landscape.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isM100Device();
Log.d(TAG, "OK: isM100Device result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isM100Device", e);
}
is7PayDevice
public static boolean is7PayDevice()
This method is used to get the device orientation.
Returns
Device orientation, for example portrait or landscape.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.is7PayDevice();
Log.d(TAG, "OK: is7PayDevice result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: is7PayDevice", e);
}
isM51Device
public boolean isM51Device()
This method is used to get the device orientation.
Returns
Device orientation, for example portrait or landscape.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isM51Device();
Log.d(TAG, "OK: isM51Device result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isM51Device", e);
}
bindService
public void bindService(android.content.Context context, ServiceConnectionCallback callback, java.lang.String accessToken)
This method is used to bind the service to access the System APIs. Use this method to bind to the service before using the System APIs.
Parameters
- context – Context of the application
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
unbindService
public void unbindService(android.content.Context context)
This method is used to unbind the service. Use this method to unbind from the service when clearing resources.
Parameters
- context – Context of the application
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unbindService(context);
Log.d(TAG, "OK: unbindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unbindService", e);
}
captureScreenShot
public boolean captureScreenShot(java.lang.String fileName)
This method is used to capture a screenshot. The screenshot will be stored in the location "/sdcard/elo/screenshot", and the return message also contains the path of the screenshot.
Parameters
- fileName – A filename in PNG format, for example "screenshot.png".
Returns
true if the screenshot is captured successfully, false otherwise.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.captureScreenShot("fileName");
Log.d(TAG, "OK: captureScreenShot result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: captureScreenShot", e);
}
setAccessibilityService
public void setAccessibilityService(java.lang.String packageName, boolean enableAccessibilityService)
This method is used to enable or disable accessibility services.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAccessibilityService("packageName", true);
Log.d(TAG, "OK: setAccessibilityService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAccessibilityService", e);
}
setMultiClientImeEnabled
public boolean setMultiClientImeEnabled(boolean enable, boolean reboot)
This method is used to enable or disable Multi-Client IME. After applying, the device will reboot to reflect the changes.
Parameters
- enable – Whether to enable or disable the feature.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setMultiClientImeEnabled(true, true);
Log.d(TAG, "OK: setMultiClientImeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setMultiClientImeEnabled", e);
}
setWifiScanning
public void setWifiScanning(boolean enable)
This method is used to enable or disable WiFi scanning.
Parameters
- enable – Whether to enable or disable WiFi scanning.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setWifiScanning(true);
Log.d(TAG, "OK: setWifiScanning result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setWifiScanning", e);
}
setBluetoothScanning
public void setBluetoothScanning(boolean enable)
This method is used to enable or disable Bluetooth scanning.
Parameters
- enable – Whether to enable or disable Bluetooth scanning.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBluetoothScanning(true);
Log.d(TAG, "OK: setBluetoothScanning result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBluetoothScanning", e);
}
setKeyListener
public boolean setKeyListener(java.lang.String packageName, java.lang.String receiverName, java.util.ArrayList<java.lang.Integer> keys, java.util.ArrayList<java.lang.Boolean> intercept)
This method is used to register a key event listener that can run in a background thread.
Parameters
- packageName – Name of the package the key listener component belongs to.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setKeyListener("packageName", "receiverName", 0, 0);
Log.d(TAG, "OK: setKeyListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setKeyListener", e);
}
getMultiClientImeEnabled
public boolean getMultiClientImeEnabled()
This method is used to get the Multi-Client IME enabled state.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMultiClientImeEnabled();
Log.d(TAG, "OK: getMultiClientImeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMultiClientImeEnabled", e);
}
setDpi
public boolean setDpi(int DPI)
This method is used to set the display DPI. A reboot is required for the change to take effect.
Parameters
- DPI – Integer value for screen density (160, 240, 320, 480, or 640).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDpi(0);
Log.d(TAG, "OK: setDpi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDpi", e);
}
setCFDDpi
public boolean setCFDDpi(int DPI)
This method is used to set the external display DPI.
Parameters
- DPI – Integer value for screen density (160, 240, 320, 480, or 640).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCFDDpi(0);
Log.d(TAG, "OK: setCFDDpi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCFDDpi", e);
}
setScreenSize
public boolean setScreenSize(int width, int height)
This method is used to set the display resolution.
Parameters
- width – Screen width in pixels.
- height – Screen height in pixels.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setScreenSize(0, 0);
Log.d(TAG, "OK: setScreenSize result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setScreenSize", e);
}
setDisplaySize
public boolean setDisplaySize(java.lang.String size)
This method is used to set the display size.
Parameters
- size – String value representing the display size.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDisplaySize("size");
Log.d(TAG, "OK: setDisplaySize result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDisplaySize", e);
}
setFontSize
public boolean setFontSize(java.lang.String size)
This method is used to set the font size.
Parameters
- size – String value representing the font size.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setFontSize("size");
Log.d(TAG, "OK: setFontSize result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setFontSize", e);
}
setSmallestPixelWidth
public boolean setSmallestPixelWidth(int smallestWidth)
This method is used to set the smallest pixel width shown in Developer Options.
Parameters
- smallestWidth – Integer value for smallest width in pixels.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setSmallestPixelWidth(0);
Log.d(TAG, "OK: setSmallestPixelWidth result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setSmallestPixelWidth", e);
}
getSmallestPixelWidth
public int getSmallestPixelWidth()
This method is used to get the smallest pixel width shown in Developer Options.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getSmallestPixelWidth();
Log.d(TAG, "OK: getSmallestPixelWidth result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getSmallestPixelWidth", e);
}
setSilentDefaultLauncher
public boolean setSilentDefaultLauncher(java.lang.String packageName)
This method is used to silently set the default launcher application.
Parameters
- packageName – Package name of the launcher application.
Returns
true if the default launcher is set successfully, false otherwise.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setSilentDefaultLauncher("packageName");
Log.d(TAG, "OK: setSilentDefaultLauncher result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setSilentDefaultLauncher", e);
}
clearAppCacheUserData
public boolean clearAppCacheUserData(java.lang.String packageNames)
This method is used to clear cache and user data of the specified applications.
Parameters
- packageNames – Comma-separated list of package names.
Returns
true if cache and user data are cleared successfully, false otherwise.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.clearAppCacheUserData("packageNames");
Log.d(TAG, "OK: clearAppCacheUserData result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: clearAppCacheUserData", e);
}
clearAllAppCacheUserData
public boolean clearAllAppCacheUserData(java.lang.String packageNames)
This method is used to clear cache and user data of all applications except those specified.
Parameters
- packageNames – Comma-separated list of package names to exclude.
Returns
true if cache and user data are cleared successfully, false otherwise.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.clearAllAppCacheUserData("packageNames");
Log.d(TAG, "OK: clearAllAppCacheUserData result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: clearAllAppCacheUserData", e);
}
setRandomWifiMacAddressEnabled
public void setRandomWifiMacAddressEnabled(boolean mac)
This method is used to enable or disable randomized WiFi MAC addressing.
Parameters
- mac – true to enable randomized MAC, false to use a fixed MAC.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setRandomWifiMacAddressEnabled(true);
Log.d(TAG, "OK: setRandomWifiMacAddressEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setRandomWifiMacAddressEnabled", e);
}
setIdleModeEnabled
public void setIdleModeEnabled(boolean IdleMode)
This method is used to enable or disable Auto-Idle mode.
Parameters
- IdleMode – Boolean value to enable or disable idle mode.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setIdleModeEnabled(true);
Log.d(TAG, "OK: setIdleModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setIdleModeEnabled", e);
}
setIdleModeTileEnabled
public int setIdleModeTileEnabled(boolean enable)
This method is used to enable or disable the Idle Mode tile. It works only in Android Home mode, GMS mode, and EloView Connect mode.
Parameters
- enable – Boolean value to enable or disable the Idle Mode tile. By default, the tile is enabled.
Returns
IdleModeTileStatus (int): 0 = success, 1 = failure, -1 = not supported
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setIdleModeTileEnabled(true);
Log.d(TAG, "OK: setIdleModeTileEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setIdleModeTileEnabled", e);
}
setNtpServerUrl
public void setNtpServerUrl(java.lang.String ntpUrl, boolean rebootRequired)
This method is used to set the NTP server address. A reboot is required for this to take effect.
Parameters
- ntpUrl – NTP server address.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNtpServerUrl("ntpUrl", true);
Log.d(TAG, "OK: setNtpServerUrl result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNtpServerUrl", e);
}
getNtpServerUrl
public java.lang.String getNtpServerUrl()
This method is used to get the NTP server address.
Returns
NTP server address
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNtpServerUrl();
Log.d(TAG, "OK: getNtpServerUrl result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNtpServerUrl", e);
}
setPasswordEnabled
public void setPasswordEnabled(boolean state)
This method is used to enable or disable showing the password while typing.
Parameters
- state – true to enable show password, false to disable show password.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPasswordEnabled(true);
Log.d(TAG, "OK: setPasswordEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPasswordEnabled", e);
}
setMicrophoneMuteEnabled
public void setMicrophoneMuteEnabled(boolean state)
This method is used to mute or unmute the microphone.
Parameters
- state – true to enable the microphone, false to disable the microphone.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setMicrophoneMuteEnabled(true);
Log.d(TAG, "OK: setMicrophoneMuteEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setMicrophoneMuteEnabled", e);
}
setLockType
public int setLockType(java.lang.String pass, java.lang.String type)
This method is used to set the lock type. If the current device lock is Password or PIN, the user will be prompted to enter the old credential before switching to Swipe or None. The getLockType method must be called before this method to override with new lock settings. If the current lock is Swipe or None, the new lock will be applied directly without a dialog.
Parameters
- type – String value to set the lock type.
Returns
0 = success, -1 = unknown error, -2 = incorrect PIN, -3 = incorrect password, -4 = system service not connected
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLockType("pass", "type");
Log.d(TAG, "OK: setLockType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLockType", e);
}
getLockType
public java.lang.String getLockType()
This method is used to get the current lock type. The output will be one of the following values: Password, PIN, Swipe, None, or Pattern. This is a required step before overriding the lock type.
Returns
Lock type
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getLockType();
Log.d(TAG, "OK: getLockType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getLockType", e);
}
getHostName
public java.lang.String getHostName()
This method is used to get the device host name.
Returns
Host name
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getHostName();
Log.d(TAG, "OK: getHostName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getHostName", e);
}
setHostName
public void setHostName(java.lang.String hostname)
This method is used to set the device host name.
Parameters
- hostname – Host name to assign to the device.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setHostName("hostname");
Log.d(TAG, "OK: setHostName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setHostName", e);
}
getChargingSoundAndVibrationEnabled
public boolean getChargingSoundAndVibrationEnabled()
This method is used to get the charging sound and vibration status.
Returns
Charging sound and vibration status
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getChargingSoundAndVibrationEnabled();
Log.d(TAG, "OK: getChargingSoundAndVibrationEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getChargingSoundAndVibrationEnabled", e);
}
setChargingSoundAndVibrationEnabled
public void setChargingSoundAndVibrationEnabled(boolean btnState)
This method is used to enable or disable charging sound and vibration.
Parameters
- btnState – true to enable, false to disable.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setChargingSoundAndVibrationEnabled(true);
Log.d(TAG, "OK: setChargingSoundAndVibrationEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setChargingSoundAndVibrationEnabled", e);
}
getScreenLockSoundEnabled
public boolean getScreenLockSoundEnabled()
This method is used to get the screen lock sound status.
Returns
Screen lock sound status
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getScreenLockSoundEnabled();
Log.d(TAG, "OK: getScreenLockSoundEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getScreenLockSoundEnabled", e);
}
setScreenLockSoundEnabled
public void setScreenLockSoundEnabled(boolean btnState)
This method is used to enable or disable the screen lock sound.
Parameters
- btnState – true to enable, false to disable.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setScreenLockSoundEnabled(true);
Log.d(TAG, "OK: setScreenLockSoundEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setScreenLockSoundEnabled", e);
}
getAutoIdleModeEnabled
public boolean getAutoIdleModeEnabled()
This method is used to get the Auto Idle Mode status.
Returns
Auto Idle Mode status
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAutoIdleModeEnabled();
Log.d(TAG, "OK: getAutoIdleModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAutoIdleModeEnabled", e);
}
getTouchSoundEnabled
public boolean getTouchSoundEnabled()
This method is used to get the Touch Sound state.
Returns
Touch Sound state
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getTouchSoundEnabled();
Log.d(TAG, "OK: getTouchSoundEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getTouchSoundEnabled", e);
}
setTouchSoundEnabled
public boolean setTouchSoundEnabled(boolean touchSound)
This method is used to set the Touch Sound.
Parameters
- touchSound – Boolean value to enable or disable touch sound.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setTouchSoundEnabled(true);
Log.d(TAG, "OK: setTouchSoundEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setTouchSoundEnabled", e);
}
setLocationEnabled
public boolean setLocationEnabled(boolean enable)
This method is used to set location services.
Parameters
- enable – Boolean value to enable or disable location services.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLocationEnabled(true);
Log.d(TAG, "OK: setLocationEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLocationEnabled", e);
}
getDpi
public int getDpi()
This method is used to get the display DPI.
Returns
DPI
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDpi();
Log.d(TAG, "OK: getDpi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDpi", e);
}
getCFDDpi
public int getCFDDpi()
This method is used to get the external display DPI.
Returns
DPI
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCFDDpi();
Log.d(TAG, "OK: getCFDDpi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCFDDpi", e);
}
getScreenSize
public java.lang.String getScreenSize()
This method is used to get the display resolution.
Returns
Display resolution
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getScreenSize();
Log.d(TAG, "OK: getScreenSize result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getScreenSize", e);
}
silentShutDown
public void silentShutDown(int delay)
This method is used to shut down the device.
Parameters
- delay – Delay in seconds before shutting down the device.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.silentShutDown(0);
Log.d(TAG, "OK: silentShutDown result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: silentShutDown", e);
}
getReservedLogSpace
public int getReservedLogSpace()
This method is used to get reserved log space on the device. Only available for builds l1-lava or newer. It will not work on 4.46.70.
Returns
Reserved log space in megabytes
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getReservedLogSpace();
Log.d(TAG, "OK: getReservedLogSpace result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getReservedLogSpace", e);
}
setReservedLogSpace
public void setReservedLogSpace(int logSpace)
This method is used to set the size of the reserved log space. Only available for builds l1-lava or newer for 3.0 devices. It will not work on 4.46.70. This API is supported on 4.0 devices. Refer to the SDK test app for proper utilization of this API.
Parameters
- logSpace – Log space to reserve. Supported values: "144", "256", "512", "756", "1024", "2048".
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setReservedLogSpace(0);
Log.d(TAG, "OK: setReservedLogSpace result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setReservedLogSpace", e);
}
setOrientation
public void setOrientation(java.lang.String orientation, boolean noRebootReq, boolean rotateISeriesorHandheld)
This method is used to set the orientation of any device.
Parameters
- orientation – Value should be "-1", "0", "90", "180", or "270".
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setOrientation("orientation", true, true);
Log.d(TAG, "OK: setOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setOrientation", e);
}
getOrientation
public java.lang.String getOrientation()
This method is used to get orientation details for all devices.
Returns
Orientation details
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getOrientation();
Log.d(TAG, "OK: getOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getOrientation", e);
}
setOrientation
public void setOrientation(java.lang.String orientation)
This method is used to set the orientation of any device.
Parameters
- orientation – Value should be "-1", "0", "90", "180", or "270".
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setOrientation("orientation");
Log.d(TAG, "OK: setOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setOrientation", e);
}
factoryReset
public void factoryReset(boolean eraseSdcard)
This method is used to perform a factory reset on the device. It will erase all internal storage records and restart the device.
Parameters
- eraseSdcard – true to erase SD card data, false to keep SD card data.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.factoryReset(true);
Log.d(TAG, "OK: factoryReset result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: factoryReset", e);
}
silentReboot
public void silentReboot()
This method is used to reboot the device.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.silentReboot();
Log.d(TAG, "OK: silentReboot result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: silentReboot", e);
}
setOrientation
public boolean setOrientation(java.lang.String orientation, boolean noRebootReq)
This method is used to set display orientation for LIDS 2.0 and BACKPACK devices only.
Parameters
- orientation – Value should be "0", "90", "180", or "270".
Returns
true on successful setOrientation, false on failure
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setOrientation("orientation", true);
Log.d(TAG, "OK: setOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setOrientation", e);
}
setBarcodeReaderEnabled
public void setBarcodeReaderEnabled(boolean enableBCR)
This method is used to enable or disable BCR.
Parameters
- enableBCR – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBarcodeReaderEnabled(true);
Log.d(TAG, "OK: setBarcodeReaderEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBarcodeReaderEnabled", e);
}
setScanBarcodeReaderEnabled
public void setScanBarcodeReaderEnabled(boolean scanBCR)
This method is used to start or stop barcode scanning.
Parameters
- scanBCR – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setScanBarcodeReaderEnabled(true);
Log.d(TAG, "OK: setScanBarcodeReaderEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setScanBarcodeReaderEnabled", e);
}
getWifiEnabled
public boolean getWifiEnabled()
This method is used to get the current WiFi status. It returns true if WiFi is enabled and false if WiFi is disabled. This method can be accessed without an access token.
Returns
true if WiFi is enabled, false if WiFi is disabled
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getWifiEnabled();
Log.d(TAG, "OK: getWifiEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getWifiEnabled", e);
}
setWifiEnabled
public void setWifiEnabled(boolean wifiState)
This method is used to change the WiFi state.
Parameters
- wifiState – Boolean (true or false). true to enable WiFi, false to disable WiFi.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setWifiEnabled(true);
Log.d(TAG, "OK: setWifiEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setWifiEnabled", e);
}
setStatusBarEnabled
public boolean setStatusBarEnabled(boolean enableStatusBar)
This method is used to enable or disable the Status Bar in Android Home mode or EloView Connect mode. After applying changes, the device requires a reboot to reflect the changes. To reboot the device, use silentReboot.
Parameters
- enableStatusBar – Boolean (true or false).
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setStatusBarEnabled(true);
Log.d(TAG, "OK: setStatusBarEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setStatusBarEnabled", e);
}
setBluetoothDevicePairingConfirmationEnabled
public boolean setBluetoothDevicePairingConfirmationEnabled(android.bluetooth.BluetoothDevice device, java.lang.Boolean enable)
This method is used to enable or disable the pairing confirmation dialog for a specific Bluetooth device.
Parameters
- device – BluetoothDevice
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBluetoothDevicePairingConfirmationEnabled(device, enable);
Log.d(TAG, "OK: setBluetoothDevicePairingConfirmationEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBluetoothDevicePairingConfirmationEnabled", e);
}
setStatusBarVisibilityEnabled
public boolean setStatusBarVisibilityEnabled(boolean visible)
This method is for Android 10. It is used to enable or disable the Status Bar and make it invisible in Android Home mode or EloView Connect mode. After applying changes, the device requires a reboot to reflect the changes. To reboot the device, use silentReboot.
Parameters
- visible – Boolean (true or false).
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setStatusBarVisibilityEnabled(true);
Log.d(TAG, "OK: setStatusBarVisibilityEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setStatusBarVisibilityEnabled", e);
}
getAutoAllowUsbPermissionEnabled
public boolean getAutoAllowUsbPermissionEnabled()
This method is used to get the current status of runtime USB permissions in Android Home mode.
Returns
true if auto-allow USB permissions is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAutoAllowUsbPermissionEnabled();
Log.d(TAG, "OK: getAutoAllowUsbPermissionEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAutoAllowUsbPermissionEnabled", e);
}
setAutoAllowUsbPermissionEnabled
public void setAutoAllowUsbPermissionEnabled(boolean grantPermission)
This method is used to grant runtime USB permissions in Android Home mode. After applying changes, the device requires a reboot to reflect the changes. On 3.0 devices, this method toggles USB permissions and the variable grantPermission is not used. For example, if automatically allowing USB permissions is currently not enabled for an app, calling this function will enable it. If auto allowing USB permissions is currently enabled, calling this function will disable it. To reboot the device, use silentReboot.
Parameters
- grantPermission – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAutoAllowUsbPermissionEnabled(true);
Log.d(TAG, "OK: setAutoAllowUsbPermissionEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAutoAllowUsbPermissionEnabled", e);
}
getNavigationBarEnabled
public boolean getNavigationBarEnabled()
This method provides the Navigation Bar status.
Returns
true if the Navigation Bar is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNavigationBarEnabled();
Log.d(TAG, "OK: getNavigationBarEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNavigationBarEnabled", e);
}
setNavigationBarEnabled
public void setNavigationBarEnabled(boolean enableNavigationBar)
This method is used to enable or disable the Navigation Bar in Android Home mode (not supported in EloView modes). By default, the Navigation Bar is enabled. After applying changes, the device requires a reboot to reflect the changes. To reboot the device, use silentReboot.
Parameters
- enableNavigationBar – Boolean (true or false). Default value is true.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNavigationBarEnabled(true);
Log.d(TAG, "OK: setNavigationBarEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNavigationBarEnabled", e);
}
getPlayProtect
public boolean getPlayProtect()
This method provides the Play Protect status.
Returns
true if Play Protect is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPlayProtect();
Log.d(TAG, "OK: getPlayProtect result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPlayProtect", e);
}
setPlayProtect
public void setPlayProtect(boolean enablePlayProtect)
This method is used to enable or disable Play Protect. Google Play Protect checks your apps and device for harmful behavior and is only available on GMS-enabled devices. After applying changes, the device requires a reboot to reflect the changes. To reboot the device, use silentReboot.
Parameters
- enablePlayProtect – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPlayProtect(true);
Log.d(TAG, "OK: setPlayProtect result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPlayProtect", e);
}
getStatusBarEnabled
public boolean getStatusBarEnabled()
This method provides the Status Bar status.
Returns
true if the Status Bar is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getStatusBarEnabled();
Log.d(TAG, "OK: getStatusBarEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getStatusBarEnabled", e);
}
getGrantAllAppPermissionEnabled
public boolean getGrantAllAppPermissionEnabled()
This method provides the status of setGrantAllAppPermissionEnabled.
Returns
true if setGrantAllAppPermissionEnabled is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getGrantAllAppPermissionEnabled();
Log.d(TAG, "OK: getGrantAllAppPermissionEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getGrantAllAppPermissionEnabled", e);
}
setGrantAllAppPermissionEnabled
public void setGrantAllAppPermissionEnabled(boolean grantPermission)
This method is used to grant all runtime permissions in Android Home mode to all apps. After applying changes, the device requires a reboot to reflect the changes. To reboot the device, use silentReboot.
Parameters
- grantPermission – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setGrantAllAppPermissionEnabled(true);
Log.d(TAG, "OK: setGrantAllAppPermissionEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setGrantAllAppPermissionEnabled", e);
}
setInstallAllAppPermissionEnabled
public boolean setInstallAllAppPermissionEnabled(boolean grantPermission)
This method is used to grant install permission to all app source packages.
Parameters
- grantPermission – Boolean (true or false).
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setInstallAllAppPermissionEnabled(true);
Log.d(TAG, "OK: setInstallAllAppPermissionEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setInstallAllAppPermissionEnabled", e);
}
setInstallPermissionToSpecificApp
public boolean setInstallPermissionToSpecificApp(java.lang.String sourcePackage, boolean state)
This method is used to grant install permission to a specific app source package.
Parameters
- sourcePackage – Package name of the app to grant install permission.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setInstallPermissionToSpecificApp("sourcePackage", true);
Log.d(TAG, "OK: setInstallPermissionToSpecificApp result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setInstallPermissionToSpecificApp", e);
}
getInstallPermissionToSpecificApp
public boolean getInstallPermissionToSpecificApp(java.lang.String sourcePkg)
This method provides the status of installSpecificAppPermission.
Parameters
- sourcePkg – Package name of the app to check install permission.
Returns
true if installSpecificAppPermission is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getInstallPermissionToSpecificApp("sourcePkg");
Log.d(TAG, "OK: getInstallPermissionToSpecificApp result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getInstallPermissionToSpecificApp", e);
}
setShowTextEditorShareMenuEnabled
public void setShowTextEditorShareMenuEnabled(boolean value)
This method is used to enable or disable showing the Share option when text is selected in Android Home mode.
Parameters
- value – Boolean (true or false). By default, this is true in Android Home mode and false in EloView mode.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setShowTextEditorShareMenuEnabled(true);
Log.d(TAG, "OK: setShowTextEditorShareMenuEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setShowTextEditorShareMenuEnabled", e);
}
setPeripheralConnectEnabled
public void setPeripheralConnectEnabled(boolean value)
This method is used to enable or disable hardware and system access from WebView via the JavaScript interface.
Parameters
- value – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPeripheralConnectEnabled(true);
Log.d(TAG, "OK: setPeripheralConnectEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPeripheralConnectEnabled", e);
}
setStarPeripheralConnectEnabled
public void setStarPeripheralConnectEnabled(boolean value)
This method is used to enable or disable Star hardware access from WebView via the JavaScript interface.
Parameters
- value – Boolean (true or false).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setStarPeripheralConnectEnabled(true);
Log.d(TAG, "OK: setStarPeripheralConnectEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setStarPeripheralConnectEnabled", e);
}
setDeviceOwner
public boolean setDeviceOwner(java.lang.String packageName, java.lang.String className) throws java.lang.NullPointerException
This function sets a component as the device owner. This function is asynchronous. The handler will be called for return data. Note that use of this API may interfere with EloView and standard device functionality.
Parameters
- packageName – Device owner package name.
Returns
true if the operation is successful, false otherwise
Throws
java.lang.NullPointerException – If NonNull parameters are empty or null
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDeviceOwner("packageName", "className");
Log.d(TAG, "OK: setDeviceOwner result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDeviceOwner", e);
}
getDeviceOwnerStatus
public java.lang.String getDeviceOwnerStatus()
This function returns the current device owner package name when the device owner is set through the SDK.
Returns
Device owner package name
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDeviceOwnerStatus();
Log.d(TAG, "OK: getDeviceOwnerStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDeviceOwnerStatus", e);
}
removeDeviceOwner
public boolean removeDeviceOwner(java.lang.String packageName) throws java.lang.SecurityException
This function removes the device owner. Note: This function can only be called by the current device owner.
Parameters
- packageName – Device owner package name.
Throws
java.lang.SecurityException – If the caller does not own the current device owner component
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.removeDeviceOwner("packageName");
Log.d(TAG, "OK: removeDeviceOwner result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: removeDeviceOwner", e);
}
setScreenWakeUp
public void setScreenWakeUp(long delay)
This method is used to wake up the screen if it is asleep. This API can be used to wake the screen after a specified delay. For example, you can set your device to sleep after a period of idle time using setBackLightTimeout and then set a wakeup time using this API.
Parameters
- delay – Number of milliseconds after which to wake the screen. For example, 15 seconds = 15*1000, 30 minutes = 30*60*1000, and 8 hours = 8*60*60*1000.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setScreenWakeUp(0L);
Log.d(TAG, "OK: setScreenWakeUp result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setScreenWakeUp", e);
}
wakeupScreen
public boolean wakeupScreen()
This method is used to wake up the screen if it is asleep.
Returns
true if successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.wakeupScreen();
Log.d(TAG, "OK: wakeupScreen result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: wakeupScreen", e);
}
setBacklightEnabled
public boolean setBacklightEnabled(boolean enable)
This method is used to turn the device backlight on or off.
Parameters
- enable – true to enable backlight, false to disable backlight.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBacklightEnabled(true);
Log.d(TAG, "OK: setBacklightEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBacklightEnabled", e);
}
setBacklightTimeOut
public boolean setBacklightTimeOut(int timeout)
This method is used to set the backlight timeout. Timeout can be from 1 second to 30 minutes, or Never. These features are currently geared towards 1.0 i-Series units only.
Parameters
- timeout – Integer value describing the number of milliseconds until timeout. Use 0 for “never” (backlight never turns off). For example, 15 seconds = 15*1000 and 30 minutes = 30*60*1000.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBacklightTimeOut(0);
Log.d(TAG, "OK: setBacklightTimeOut result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBacklightTimeOut", e);
}
getBacklightTimeOut
public int getBacklightTimeOut()
This method is used to get the currently set backlight timeout.
Returns
Integer value of the current backlight timeout in milliseconds
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getBacklightTimeOut();
Log.d(TAG, "OK: getBacklightTimeOut result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getBacklightTimeOut", e);
}
setTimeZone
public boolean setTimeZone(java.lang.String timezone)
This method is used to set the timezone on the device.
Parameters
- timezone – A standard TimeZone ID. You can get available TimeZone IDs using android.icu.util.TimeZone.getAvailableIDs()
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setTimeZone("timezone");
Log.d(TAG, "OK: setTimeZone result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setTimeZone", e);
}
getTimeZone
public java.lang.String getTimeZone()
This method is used to get the timezone set on the device.
Returns
String value of the currently set timezone.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getTimeZone();
Log.d(TAG, "OK: getTimeZone result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getTimeZone", e);
}
getLanguage
public java.lang.String getLanguage()
This method is used to get the language set on the device.
Returns
String value of the currently set language.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getLanguage();
Log.d(TAG, "OK: getLanguage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getLanguage", e);
}
setLanguage
public boolean setLanguage(java.lang.String locale)
This method is used to set the language on the device.
Parameters
- locale – A standard language code.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLanguage("locale");
Log.d(TAG, "OK: setLanguage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLanguage", e);
}
setDateTime
public void setDateTime(long epoch)
This method is used to set the date and time on the device.
Parameters
- epoch – Date and time in epoch milliseconds. An epoch is the number of milliseconds since January 1, 1970. Refer to the test application code to see how to obtain the epoch time.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDateTime(0L);
Log.d(TAG, "OK: setDateTime result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDateTime", e);
}
setNtpPollInterval
public boolean setNtpPollInterval(long interval, java.lang.Boolean rebootRequired)
This method is used to set the NTP client polling interval for the device.
Parameters
- interval – Interval to poll in milliseconds. The minimum interval is 15 minutes (900000 ms).
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNtpPollInterval(0, rebootRequired);
Log.d(TAG, "OK: setNtpPollInterval result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNtpPollInterval", e);
}
getNtpPollInterval
public long getNtpPollInterval()
This method is used to get the NTP poll interval set on the device.
Returns
int value of the currently set NTP poll interval.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNtpPollInterval();
Log.d(TAG, "OK: getNtpPollInterval result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNtpPollInterval", e);
}
setAutoDateTimeEnabled
public void setAutoDateTimeEnabled(boolean AutoDateTime)
This method is used to enable or disable setting automatic date and time from the network on the device.
Parameters
- AutoDateTime – true to enable automatic date and time, false to disable automatic date and time.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAutoDateTimeEnabled(true);
Log.d(TAG, "OK: setAutoDateTimeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAutoDateTimeEnabled", e);
}
setTimeFormatEnabled
public void setTimeFormatEnabled(boolean TimeFormat_24)
This method is used to set the time format.
Parameters
- TimeFormat_24 – true to set 24-hour format, false to set 12-hour format.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setTimeFormatEnabled(true);
Log.d(TAG, "OK: setTimeFormatEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setTimeFormatEnabled", e);
}
setEloNetworkConf
public int setEloNetworkConf(android.content.Context ctx, android.net.Uri CsvURL)
This method is used to set the network configurations for WiFi.
Parameters
- ctx – A context object of the calling class (Activity or Service).
Returns
0 = success, -1 = failure to parse file, -2 = incorrect file format
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setEloNetworkConf(context, CsvURL);
Log.d(TAG, "OK: setEloNetworkConf result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setEloNetworkConf", e);
}
setPowerButtonEnabled
public void setPowerButtonEnabled(boolean enable)
This method is used to enable or disable the Power button.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPowerButtonEnabled(true);
Log.d(TAG, "OK: setPowerButtonEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPowerButtonEnabled", e);
}
setHomeButtonEnabled
public void setHomeButtonEnabled(boolean enable)
This method is used to enable the Home button.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setHomeButtonEnabled(true);
Log.d(TAG, "OK: setHomeButtonEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setHomeButtonEnabled", e);
}
setVolumePanelShowMoreEnabled
public void setVolumePanelShowMoreEnabled(boolean enable)
This method is used to enable the Show more option in the volume panel.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setVolumePanelShowMoreEnabled(true);
Log.d(TAG, "OK: setVolumePanelShowMoreEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setVolumePanelShowMoreEnabled", e);
}
setTextEditorAssistMenuEnabled
public void setTextEditorAssistMenuEnabled(boolean enable)
This method is used to enable or disable the Assist menu in the text editor.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setTextEditorAssistMenuEnabled(true);
Log.d(TAG, "OK: setTextEditorAssistMenuEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setTextEditorAssistMenuEnabled", e);
}
setLockScreenPassword
public int setLockScreenPassword(android.content.Context context, java.lang.String newPassword, boolean autoUnlock)
API used to apply the screen lock password for the first time only.
Parameters
- context – Context
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLockScreenPassword(context, "newPassword", true);
Log.d(TAG, "OK: setLockScreenPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLockScreenPassword", e);
}
setLockScreenPin
public int setLockScreenPin(android.content.Context context, java.lang.String newPin, boolean autoUnlock)
API used to apply the screen lock PIN for the first time only.
Parameters
- context – Context
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLockScreenPin(context, "newPin", true);
Log.d(TAG, "OK: setLockScreenPin result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLockScreenPin", e);
}
changeLockScreenPassword
public int changeLockScreenPassword(android.content.Context context, java.lang.String oldPassword, java.lang.String newPassword, boolean autoUnlock)
API used to apply the screen lock password.
Parameters
- context – Context
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.changeLockScreenPassword(context, "oldPassword", "newPassword", true);
Log.d(TAG, "OK: changeLockScreenPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: changeLockScreenPassword", e);
}
changeLockScreenPin
public int changeLockScreenPin(android.content.Context context, java.lang.String oldPin, java.lang.String newPin, boolean autoUnlock)
API used to change the screen lock PIN when a screen lock PIN is already set.
Parameters
- context – Context
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.changeLockScreenPin(context, "oldPin", "newPin", true);
Log.d(TAG, "OK: changeLockScreenPin result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: changeLockScreenPin", e);
}
startActivityFromForegroundService
public void startActivityFromForegroundService(android.content.Context context, android.content.Intent activityIntent, android.app.Service foregroundService)
API used to create and show a notification, and start an activity from a foreground service. This method must be called from a foreground service. The notification is created with default text "ELo SDK Foreground service notification".
Parameters
- context – Context
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.startActivityFromForegroundService(context, activityIntent, foregroundService);
Log.d(TAG, "OK: startActivityFromForegroundService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: startActivityFromForegroundService", e);
}
setVolumeLevel
public boolean setVolumeLevel(java.lang.String volumeType, int value)
This method is used to set the volume for "Alarm", "Call", "Media", "Notification", or "All".
Parameters
- volumeType – Volume type ("Alarm", "Call", "Media", "Notification", or "All").
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setVolumeLevel("volumeType", 0);
Log.d(TAG, "OK: setVolumeLevel result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setVolumeLevel", e);
}
setCopyPasteModeEnabled
public void setCopyPasteModeEnabled(boolean copyPasteMode)
This method is used to enable or disable copy and paste functionality on the device.
Parameters
- copyPasteMode – Boolean (true or false) to enable or disable copy and paste functionality.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCopyPasteModeEnabled(true);
Log.d(TAG, "OK: setCopyPasteModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCopyPasteModeEnabled", e);
}
setMediaProjectionPermissionAllApps
public void setMediaProjectionPermissionAllApps(boolean allowAutoPermit)
This method is used to enable or disable automatically allowing MediaProjection permission for all apps.
Parameters
- allowAutoPermit – Boolean (true or false) to enable or disable MediaProjection permission auto-allow.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setMediaProjectionPermissionAllApps(true);
Log.d(TAG, "OK: setMediaProjectionPermissionAllApps result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setMediaProjectionPermissionAllApps", e);
}
getMediaProjectionPermissionAllApps
public boolean getMediaProjectionPermissionAllApps()
This method is used to check whether MediaProjection permission is automatically allowed for all apps.
Returns
true if MediaProjection permission is allowed for all apps, false if it is not allowed
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMediaProjectionPermissionAllApps();
Log.d(TAG, "OK: getMediaProjectionPermissionAllApps result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMediaProjectionPermissionAllApps", e);
}
setMediaProjectionPermission
public void setMediaProjectionPermission(java.lang.String pkgName)
This method is used to allow a specific package to have MediaProjection permission.
Parameters
- pkgName – Package name that needs permission.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setMediaProjectionPermission("pkgName");
Log.d(TAG, "OK: setMediaProjectionPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setMediaProjectionPermission", e);
}
getMediaProjectionPermission
public java.lang.String getMediaProjectionPermission()
This method returns the packages allowed for MediaProjection permission.
Returns
Comma-separated string listing all packages allowed for MediaProjection permission
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMediaProjectionPermission();
Log.d(TAG, "OK: getMediaProjectionPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMediaProjectionPermission", e);
}
setVirtualKeyBoard
public void setVirtualKeyBoard(java.lang.String virtualKeyboard)
This method is used to set the virtual keyboard on the device.
Parameters
- virtualKeyboard – Virtual keyboard component name.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setVirtualKeyBoard("virtualKeyboard");
Log.d(TAG, "OK: setVirtualKeyBoard result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setVirtualKeyBoard", e);
}
setEloLoggingEnabled
public void setEloLoggingEnabled(boolean enable)
This method is used to enable or disable Elo logging functionality.
Parameters
- enable – true to enable logging, false to disable logging.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setEloLoggingEnabled(true);
Log.d(TAG, "OK: setEloLoggingEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setEloLoggingEnabled", e);
}
setAdbPort
public boolean setAdbPort(java.lang.String portNumber)
This method is used to set a custom ADB TCP port.
Parameters
- portNumber – Chosen port number. Port numbers should be odd numbers in the range 5555 to 5585.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAdbPort("portNumber");
Log.d(TAG, "OK: setAdbPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAdbPort", e);
}
setAdbEnabled
public void setAdbEnabled(boolean enable)
This method is used to enable ADB.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAdbEnabled(true);
Log.d(TAG, "OK: setAdbEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAdbEnabled", e);
}
setDarkModeEnabled
public void setDarkModeEnabled(boolean enable)
This method is used to toggle dark mode on the device.
Parameters
- enable – true to enable dark mode, false to disable dark mode.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDarkModeEnabled(true);
Log.d(TAG, "OK: setDarkModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDarkModeEnabled", e);
}
setNotificationStatusEnabled
public void setNotificationStatusEnabled(boolean status)
This method is used to enable or disable notifications with the status bar.
Parameters
- status – true to disable notifications, false to enable notifications.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNotificationStatusEnabled(true);
Log.d(TAG, "OK: setNotificationStatusEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNotificationStatusEnabled", e);
}
setLockStatusBarEnabled
public void setLockStatusBarEnabled(boolean status)
This method is used to enable or disable Status Bar swipe lock.
Parameters
- status – Status.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setLockStatusBarEnabled(true);
Log.d(TAG, "OK: setLockStatusBarEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setLockStatusBarEnabled", e);
}
spFirmwareUpgrade
public boolean spFirmwareUpgrade()
This method is used to upgrade the secure processor firmware on M60 payment devices. First add the firmware file QE1000_new.uld to /sdcard/Download/.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.spFirmwareUpgrade();
Log.d(TAG, "OK: spFirmwareUpgrade result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: spFirmwareUpgrade", e);
}
getStickyEloViewModeEnabled
public boolean getStickyEloViewModeEnabled()
This method is used to get the status of sticky EloView boot mode.
Returns
true if sticky EloView boot mode is enabled, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getStickyEloViewModeEnabled();
Log.d(TAG, "OK: getStickyEloViewModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getStickyEloViewModeEnabled", e);
}
setStickyEloViewModeEnabled
public void setStickyEloViewModeEnabled(boolean stickyMode)
This method is used to set sticky EloView boot mode.
Parameters
- stickyMode – true to enable sticky EloView boot mode, false to disable it.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setStickyEloViewModeEnabled(true);
Log.d(TAG, "OK: setStickyEloViewModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setStickyEloViewModeEnabled", e);
}
setRecentButtonEnabled
public void setRecentButtonEnabled(boolean enable)
This method is used to enable the Recent button.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setRecentButtonEnabled(true);
Log.d(TAG, "OK: setRecentButtonEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setRecentButtonEnabled", e);
}
setFirmwareStatusLockEnabled
public boolean setFirmwareStatusLockEnabled(boolean status)
This method is used to lock or unlock secure processor firmware updates.
Parameters
- status – true to lock firmware upgrade, false to unlock.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setFirmwareStatusLockEnabled(true);
Log.d(TAG, "OK: setFirmwareStatusLockEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setFirmwareStatusLockEnabled", e);
}
getFirmwareStatusLockEnabled
public int getFirmwareStatusLockEnabled()
This method is used to get the secure processor firmware status.
Returns
0 if locked, 1 if PCI flag is on, 2 if PCI flag is off, -1 on error
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getFirmwareStatusLockEnabled();
Log.d(TAG, "OK: getFirmwareStatusLockEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getFirmwareStatusLockEnabled", e);
}
setMultiAppModeEnabled
public boolean setMultiAppModeEnabled(android.content.Context context, boolean status)
This method is used to change app mode (enable = multi app mode, disable = single app mode).
Parameters
- context – A context object of the calling class (Activity or Service).
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setMultiAppModeEnabled(context, true);
Log.d(TAG, "OK: setMultiAppModeEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setMultiAppModeEnabled", e);
}
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}
writeSystemProperty
public void writeSystemProperty(java.lang.String key, java.lang.String value)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.writeSystemProperty("key", "value");
Log.d(TAG, "OK: writeSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: writeSystemProperty", e);
}
setBluetoothEnabled
public void setBluetoothEnabled(boolean bluetoothState)
This method is used to enable or disable Bluetooth.
Parameters
- bluetoothState – "Enable" to enable Bluetooth and "Disable" to disable Bluetooth.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBluetoothEnabled(true);
Log.d(TAG, "OK: setBluetoothEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBluetoothEnabled", e);
}
setUSBPorts
public void setUSBPorts(java.lang.String json)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setUSBPorts("json");
Log.d(TAG, "OK: setUSBPorts result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setUSBPorts", e);
}
setShowTapsEnabled
public void setShowTapsEnabled(boolean showTapsState)
This method is used to enable or disable Show taps.
Parameters
- showTapsState – "Enable" to enable Show taps and "Disable" to disable Show taps.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setShowTapsEnabled(true);
Log.d(TAG, "OK: setShowTapsEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setShowTapsEnabled", e);
}
setExternalAudioDeviceEnabled
public void setExternalAudioDeviceEnabled(boolean externalSpeakerState)
This method is used to select internal or external speaker.
Parameters
- externalSpeakerState – true for external speaker and false for internal speaker.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setExternalAudioDeviceEnabled(true);
Log.d(TAG, "OK: setExternalAudioDeviceEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setExternalAudioDeviceEnabled", e);
}
getHotspotAccessibilityEnabled
public boolean getHotspotAccessibilityEnabled()
This method is used to get the status of hotspot accessibility.
Returns
true if the operation is successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getHotspotAccessibilityEnabled();
Log.d(TAG, "OK: getHotspotAccessibilityEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getHotspotAccessibilityEnabled", e);
}
setHotspotAccessibilityEnabled
public void setHotspotAccessibilityEnabled(boolean status)
This method is used to enable or disable hotspot accessibility.
Parameters
- status – The status.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setHotspotAccessibilityEnabled(true);
Log.d(TAG, "OK: setHotspotAccessibilityEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setHotspotAccessibilityEnabled", e);
}
verifyFileSignature
public java.lang.String verifyFileSignature(java.lang.String absoluteFilePath, java.lang.String absoluteSha256Path)
This method is used to verify the signature of the file.
Parameters
- absoluteFilePath – Absolute file path of the original file to verify integrity.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.verifyFileSignature("absoluteFilePath", "absoluteSha256Path");
Log.d(TAG, "OK: verifyFileSignature result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: verifyFileSignature", e);
}
getMD5Checksum
public java.lang.String getMD5Checksum(java.lang.String absoluteFilePath)
This method is used to verify the signature of the file.
Parameters
- absoluteFilePath – accessToken
Returns
md5 checksum of the file
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMD5Checksum("absoluteFilePath");
Log.d(TAG, "OK: getMD5Checksum result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMD5Checksum", e);
}
getShowInsetsOnSwipe
public boolean getShowInsetsOnSwipe()
Function used to retrieve true or false value for whether status and navigation bars (insets) will be shown when swiping from top or bottom of screen after insets are hidden using native Android APIs. The value will always be false in EloView mode. This value can be changed with setShowInsetsOnSwipe in GMS and Android home mode.
Returns
true or false value for whether insets will be shown when swiping from top or bottom of screen
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getShowInsetsOnSwipe();
Log.d(TAG, "OK: getShowInsetsOnSwipe result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getShowInsetsOnSwipe", e);
}
setShowInsetsOnSwipe
public void setShowInsetsOnSwipe(boolean show)
Function used to hide or show status and navigation bars (insets) when swiping from top or bottom of screen after insets are hidden using native Android APIs. This function is only supported in GMS and Android home mode.
Parameters
- show – Whether to show insets when swiping from top or bottom of screen.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setShowInsetsOnSwipe(true);
Log.d(TAG, "OK: setShowInsetsOnSwipe result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setShowInsetsOnSwipe", e);
}
testPeripheralMode
public void testPeripheralMode()
Function used to launch test peripheral mode. testPeripheralMode() was present in EloSecure since Android 10. However, this was added in AIDL in MR-22 (Value Android 12) as part of replacing the EloAPIService (IntentService) calls from Elohub to EloSecure with AIDL calls from Elohub to EloViewHomeSDK. This won't be available for call from lower MRs/SMRs.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.testPeripheralMode();
Log.d(TAG, "OK: testPeripheralMode result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: testPeripheralMode", e);
}
copyFile
public boolean copyFile(java.lang.String source, java.lang.String destination)
Function used to copy a file from the source path to the destination path.
Parameters
- source – Source path from where the file is to be copied.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.copyFile("source", "destination");
Log.d(TAG, "OK: copyFile result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: copyFile", e);
}
writeFile
public boolean writeFile(java.lang.String destination, java.lang.String data, boolean readable, boolean append, boolean overwrite)
Function used to create a file at a destination path with the given data.
Parameters
- destination – Destination path where the file is to be created.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.writeFile("destination", "data", true, true, true);
Log.d(TAG, "OK: writeFile result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: writeFile", e);
}
verifyFileSignature
public java.lang.String verifyFileSignature(byte[] zipFileByteArray)
This method is used to verify file integrity from zip file bytes. EloPayService receives this zip file bytes. Then, it verifies the signature integrity of each file bytes of zip file.
Parameters
- zipFileByteArray – Byte array of the zip file.
Returns
A JSON string containing information about the processed file:
- "fileName": Name of the saved file
- "SignatureMatch": Boolean indicating if the signature matched
- "errorMessage": Error details if verification failed
- "SHA256": SHA-256 hash of the original file
- "MD5originalfile": MD5 hash of the original file
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.verifyFileSignature(zipFileByteArray);
Log.d(TAG, "OK: verifyFileSignature result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: verifyFileSignature", e);
}
writeSignedFileToStorage
public java.lang.String writeSignedFileToStorage(byte[] zipFileByteArray)
This API will verify the zip file bytes and copy the file to the /data/CastlesFile/protected folder. After verifying the signature integrity, if it is passed, the file bytes are copied to the /data/CastlesFile/protected folder.
Parameters
- zipFileByteArray – Byte array of the zip file.
Returns
A JSON string containing information about the processed file:
- "fileName": Name of the saved file
- "SignatureMatch": Boolean indicating if the signature matched
- "errorMessage": Error details if verification failed
- "SHA256": SHA-256 hash of the original file
- "MD5originalfile": MD5 hash of the original file
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.writeSignedFileToStorage(zipFileByteArray);
Log.d(TAG, "OK: writeSignedFileToStorage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: writeSignedFileToStorage", e);
}
enableSecureWhiteListMode
public java.lang.String enableSecureWhiteListMode()
This API will enable BIN whitelisting mode on the payment device. For successful operation: "WhiteListMode Enabled successfully" For fail operation: "WhiteListMode Enable Failed"
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.enableSecureWhiteListMode();
Log.d(TAG, "OK: enableSecureWhiteListMode result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: enableSecureWhiteListMode", e);
}
getSecureWhitelistModeStatus
public boolean getSecureWhitelistModeStatus()
This API will result "TRUE" if BIN whitelisting is already enabled or will result "FALSE"
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getSecureWhitelistModeStatus();
Log.d(TAG, "OK: getSecureWhitelistModeStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getSecureWhitelistModeStatus", e);
}
setExternalScreenOrientation
public boolean setExternalScreenOrientation(java.lang.String orientation)
This method is used to set external screen orientation.
Parameters
- orientation – Value should be "0", "90", "180", or "270".
Returns
boolean true on successful setOrientation, false on fail
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setExternalScreenOrientation("orientation");
Log.d(TAG, "OK: setExternalScreenOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setExternalScreenOrientation", e);
}
getExternalScreenOrientation
public java.lang.String getExternalScreenOrientation()
This method is used to get external screen orientation details.
Returns
external screen orientation.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getExternalScreenOrientation();
Log.d(TAG, "OK: getExternalScreenOrientation result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getExternalScreenOrientation", e);
}
setBrightness
public void setBrightness(int value)
This method is used to set the brightness of the device.
Parameters
- value – 0 to 100.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setBrightness(0);
Log.d(TAG, "OK: setBrightness result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setBrightness", e);
}
Network APIs
CertificateConfig
This is a model class used to keep the certificate configuration data. The user saves certificate configuration into this class and provides it to Network.installLocalCertificate(android.content.Context, com.eloview.sdk.networkManager.CertificateConfig). It consists of the following information for CA and USER CERTIFICATE installation:
- certificateName: test
- certificateType: CA / USER CERTIFICATE
- certificatePassword: password (required for USER_CERTIFICATE)
- certificateFilePath: /sdcard/certificate.pem
getCertPath
public java.lang.String getCertPath()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCertPath();
Log.d(TAG, "OK: getCertPath result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCertPath", e);
}
setCertPath
public void setCertPath(java.lang.String certPath)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCertPath("certPath");
Log.d(TAG, "OK: setCertPath result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCertPath", e);
}
getCertName
public java.lang.String getCertName()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCertName();
Log.d(TAG, "OK: getCertName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCertName", e);
}
setCertName
public void setCertName(java.lang.String certName)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCertName("certName");
Log.d(TAG, "OK: setCertName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCertName", e);
}
getCertType
public CertificateType getCertType()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCertType();
Log.d(TAG, "OK: getCertType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCertType", e);
}
setCertType
public void setCertType(CertificateType certType)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCertType(certType);
Log.d(TAG, "OK: setCertType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCertType", e);
}
getUserCertPwd
public java.lang.String getUserCertPwd()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getUserCertPwd();
Log.d(TAG, "OK: getUserCertPwd result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getUserCertPwd", e);
}
setUserCertPwd
public void setUserCertPwd(java.lang.String userCertPwd)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setUserCertPwd("userCertPwd");
Log.d(TAG, "OK: setUserCertPwd result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setUserCertPwd", e);
}
toString
public java.lang.String toString()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.toString();
Log.d(TAG, "OK: toString result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: toString", e);
}
describeContents
public int describeContents()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.describeContents();
Log.d(TAG, "OK: describeContents result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: describeContents", e);
}
Enum CertificateType
CertificateConfig only accepts a certificate type defined in the CertificateType enum.
values
public static CertificateType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.values();
Log.d(TAG, "OK: values result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: values", e);
}
valueOf
public static CertificateType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.valueOf("name");
Log.d(TAG, "OK: valueOf result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: valueOf", e);
}
Enum NetworkSecurityType
NetworkConfig only accepts a security type defined in the NetworkSecurityType enum.
values
public static NetworkSecurityType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.values();
Log.d(TAG, "OK: values result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: values", e);
}
valueOf
public static NetworkSecurityType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.valueOf("name");
Log.d(TAG, "OK: valueOf result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: valueOf", e);
}
Enum NetworkType
NetworkConfig only accepts a network type defined in the NetworkType enum.
values
public static NetworkType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.values();
Log.d(TAG, "OK: values result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: values", e);
}
valueOf
public static NetworkType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.valueOf("name");
Log.d(TAG, "OK: valueOf result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: valueOf", e);
}
ESTConfig
ESTConfig class contains the certificate details required for EST certificate installation. It consists of the following information:
- url: 192.168.2.1
- port: 8085
- alias: test
- estUsername: username
- estPassword: password
- certificateFilePath: /sdcard/certificate.pem
getUrl
public java.lang.String getUrl()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getUrl();
Log.d(TAG, "OK: getUrl result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getUrl", e);
}
setUrl
public void setUrl(java.lang.String url)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setUrl("url");
Log.d(TAG, "OK: setUrl result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setUrl", e);
}
getPort
public java.lang.String getPort()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPort();
Log.d(TAG, "OK: getPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPort", e);
}
setPort
public void setPort(java.lang.String port)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPort("port");
Log.d(TAG, "OK: setPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPort", e);
}
getAlias
public java.lang.String getAlias()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAlias();
Log.d(TAG, "OK: getAlias result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAlias", e);
}
setAlias
public void setAlias(java.lang.String alias)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAlias("alias");
Log.d(TAG, "OK: setAlias result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAlias", e);
}
getEstUsername
public java.lang.String getEstUsername()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEstUsername();
Log.d(TAG, "OK: getEstUsername result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEstUsername", e);
}
setEstUsername
public void setEstUsername(java.lang.String estUsername)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setEstUsername("estUsername");
Log.d(TAG, "OK: setEstUsername result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setEstUsername", e);
}
getEstPassword
public java.lang.String getEstPassword()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEstPassword();
Log.d(TAG, "OK: getEstPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEstPassword", e);
}
setEstPassword
public void setEstPassword(java.lang.String estPassword)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setEstPassword("estPassword");
Log.d(TAG, "OK: setEstPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setEstPassword", e);
}
getCertificateFilePath
public java.lang.String getCertificateFilePath()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCertificateFilePath();
Log.d(TAG, "OK: getCertificateFilePath result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCertificateFilePath", e);
}
setCertificateFilePath
public void setCertificateFilePath(java.lang.String certificateFilePath)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setCertificateFilePath("certificateFilePath");
Log.d(TAG, "OK: setCertificateFilePath result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setCertificateFilePath", e);
}
describeContents
public int describeContents()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.describeContents();
Log.d(TAG, "OK: describeContents result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: describeContents", e);
}
Network
The Network class provides the following functions:
- setNetwork – Connect to a user-defined network configuration.
- getNetwork – Retrieve information about the current network, such as network name, type, IP address, and MAC address.
- getWiFiMac – Return the Wi-Fi MAC address.
- getEthernetMac – Return the Ethernet MAC address.
- installCertificate – Send the EST certificate configuration request and generate user and CA certificates.
- removeCertificate – Remove EST user and CA certificates.
- installLocalCertificate – Install local Wi-Fi certificates when the device is offline.
- setEthState – Power on or off the Ethernet port.
- getDHCPServerHostName – Retrieve the DHCP server host name.
- unregisterCertificatesListener – Unregister the broadcast receiver used during certificate installation.
- readSystemProperty – Read a system property.
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}
setNetwork
public void setNetwork(android.content.Context context, java.lang.String accessToken, NetworkConfig networkConfig, android.os.Handler handler)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNetwork(context, "accessToken", networkConfig, handler);
Log.d(TAG, "OK: setNetwork result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNetwork", e);
}
setNetwork (with disableEthernet)
public void setNetwork(android.content.Context context, java.lang.String accessToken, NetworkConfig networkConfig, android.os.Handler handler, java.lang.Boolean disableEthernet)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNetwork(context, "accessToken", networkConfig, handler, disableEthernet);
Log.d(TAG, "OK: setNetwork result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNetwork", e);
}
getNetwork
public void getNetwork(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNetwork(context, "accessToken", handler);
Log.d(TAG, "OK: getNetwork result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNetwork", e);
}
getEthState
public boolean getEthState()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEthState();
Log.d(TAG, "OK: getEthState result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEthState", e);
}
setEthState
public void setEthState(boolean state)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setEthState(true);
Log.d(TAG, "OK: setEthState result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setEthState", e);
}
unregisterCertificatesListener
public void unregisterCertificatesListener(android.content.Context context)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unregisterCertificatesListener(context);
Log.d(TAG, "OK: unregisterCertificatesListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unregisterCertificatesListener", e);
}
getWiFiMac
public java.lang.String getWiFiMac()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getWiFiMac();
Log.d(TAG, "OK: getWiFiMac result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getWiFiMac", e);
}
getEthernetMac
public java.lang.String getEthernetMac()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEthernetMac();
Log.d(TAG, "OK: getEthernetMac result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEthernetMac", e);
}
getDHCPServerHostName
public java.lang.String getDHCPServerHostName()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDHCPServerHostName();
Log.d(TAG, "OK: getDHCPServerHostName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDHCPServerHostName", e);
}
setNetmask
public java.lang.String setNetmask(NetworkConfig networkConfig, java.lang.String netmask)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNetmask(networkConfig, "netmask");
Log.d(TAG, "OK: setNetmask result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNetmask", e);
}
installCertificate
public void installCertificate(android.content.Context context, ESTConfig estConfig, android.os.Handler handler)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.installCertificate(context, estConfig, handler);
Log.d(TAG, "OK: installCertificate result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: installCertificate", e);
}
removeCertificate
public boolean removeCertificate(java.lang.String alias)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.removeCertificate("alias");
Log.d(TAG, "OK: removeCertificate result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: removeCertificate", e);
}
installLocalCertificate
public boolean installLocalCertificate(android.content.Context context, CertificateConfig certificateConfig)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.installLocalCertificate(context, certificateConfig);
Log.d(TAG, "OK: installLocalCertificate result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: installLocalCertificate", e);
}
bindService
public void bindService(android.content.Context context, ServiceConnectionCallback callback, java.lang.String accessToken)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
NetworkConfig
getNetworkType
public NetworkType getNetworkType()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNetworkType();
Log.d(TAG, "OK: getNetworkType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNetworkType", e);
}
getProxyHost
public java.lang.String getProxyHost()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getProxyHost();
Log.d(TAG, "OK: getProxyHost result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getProxyHost", e);
}
setProxyHost
public void setProxyHost(java.lang.String proxyHost)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setProxyHost("proxyHost");
Log.d(TAG, "OK: setProxyHost result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setProxyHost", e);
}
getName
public java.lang.String getName()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getName();
Log.d(TAG, "OK: getName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getName", e);
}
setName
public void setName(java.lang.String name)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setName("name");
Log.d(TAG, "OK: setName result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setName", e);
}
getSecurityType
public NetworkSecurityType getSecurityType()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getSecurityType();
Log.d(TAG, "OK: getSecurityType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getSecurityType", e);
}
setSecurityType
public void setSecurityType(NetworkSecurityType securityType)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setSecurityType(securityType);
Log.d(TAG, "OK: setSecurityType result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setSecurityType", e);
}
getPassword
public java.lang.String getPassword()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPassword();
Log.d(TAG, "OK: getPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPassword", e);
}
setPassword
public void setPassword(java.lang.String password)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPassword("password");
Log.d(TAG, "OK: setPassword result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPassword", e);
}
getProxyPort
public java.lang.Integer getProxyPort()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getProxyPort();
Log.d(TAG, "OK: getProxyPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getProxyPort", e);
}
setProxyPort
public void setProxyPort(java.lang.Integer proxyPort)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setProxyPort(0);
Log.d(TAG, "OK: setProxyPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setProxyPort", e);
}
getStaticIp
public java.lang.String getStaticIp()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getStaticIp();
Log.d(TAG, "OK: getStaticIp result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getStaticIp", e);
}
setStaticIp
public void setStaticIp(java.lang.String staticIp)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setStaticIp("staticIp");
Log.d(TAG, "OK: setStaticIp result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setStaticIp", e);
}
getGateway
public java.lang.String getGateway()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getGateway();
Log.d(TAG, "OK: getGateway result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getGateway", e);
}
setGateway
public void setGateway(java.lang.String gateway)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setGateway("gateway");
Log.d(TAG, "OK: setGateway result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setGateway", e);
}
getNetworkPrefix
public java.lang.String getNetworkPrefix()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getNetworkPrefix();
Log.d(TAG, "OK: getNetworkPrefix result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getNetworkPrefix", e);
}
setNetworkPrefix
public void setNetworkPrefix(java.lang.String networkPrefix)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setNetworkPrefix("networkPrefix");
Log.d(TAG, "OK: setNetworkPrefix result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setNetworkPrefix", e);
}
getDns1
public java.lang.String getDns1()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDns1();
Log.d(TAG, "OK: getDns1 result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDns1", e);
}
setDns1
public void setDns1(java.lang.String dns1)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDns1("dns1");
Log.d(TAG, "OK: setDns1 result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDns1", e);
}
getDns2
public java.lang.String getDns2()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDns2();
Log.d(TAG, "OK: getDns2 result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDns2", e);
}
setDns2
public void setDns2(java.lang.String dns2)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDns2("dns2");
Log.d(TAG, "OK: setDns2 result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDns2", e);
}
getProxyExclusion
public java.util.List<java.lang.String> getProxyExclusion()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getProxyExclusion();
Log.d(TAG, "OK: getProxyExclusion result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getProxyExclusion", e);
}
setProxyExclusion
public void setProxyExclusion(java.util.List<java.lang.String> proxyExclusion)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setProxyExclusion(proxyExclusion);
Log.d(TAG, "OK: setProxyExclusion result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setProxyExclusion", e);
}
getAvoidPoorWifi
public java.lang.Boolean getAvoidPoorWifi()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAvoidPoorWifi();
Log.d(TAG, "OK: getAvoidPoorWifi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAvoidPoorWifi", e);
}
setAvoidPoorWifi
public void setAvoidPoorWifi(java.lang.Boolean avoidPoorWifi)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAvoidPoorWifi(avoidPoorWifi);
Log.d(TAG, "OK: setAvoidPoorWifi result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAvoidPoorWifi", e);
}
getDefaultExclude
public java.lang.Boolean getDefaultExclude()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDefaultExclude();
Log.d(TAG, "OK: getDefaultExclude result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDefaultExclude", e);
}
setDefaultExclude
public void setDefaultExclude(java.lang.Boolean defaultExclude)
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setDefaultExclude(defaultExclude);
Log.d(TAG, "OK: setDefaultExclude result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setDefaultExclude", e);
}
getCertAlias
public java.lang.String getCertAlias()
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getCertAlias();
Log.d(TAG, "OK: getCertAlias result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getCertAlias", e);
}
Package & Apps APIs
Package
The Package class provides the following operations:
-
Install an APK file silently without any user interaction using
silentPackageInstall. -
Uninstall a package silently without any user interaction using
silentPackageUninstall. -
Set the package name and permission using
setPackageNameAndPermission. -
Enable a package silently using
enablePackage. -
Disable a package silently using
disablePackage. -
Force stop a given package using
stopPackage. -
Whitelist the given package permissions using
setWhitelistAppPermission(automatically grants runtime permissions on install). -
Clear whitelisted packages using
clearWhitelistAppPermission. -
Clear all whitelisted packages using
clearAllWhitelistAppPermission. -
Enable or create whitelist rules using
enableWhitelistPackages. -
Disable whitelist rules using
disableWhitelistPackages. -
Check whether a package is enabled or disabled using
getPackageStatus. -
Automatically start and pin an app on every reboot using
setAppAutostartPinned. -
Remove auto-start pinned state using
removeAppAutoStartPinned. -
Get pinned app status using
getAppAutoStartPinnedStatus. -
Read system properties using
readSystemProperty. -
Enable or disable the Settings app using
setSettingsPackageEnabled. -
Unregister package install listeners using
unregisterPackageInstallAPIListener. -
Unregister package status listeners using
unregisterPackageStatusChangeListener. -
Unregister package uninstall listeners using
unregisterPackageUninstallAPIListener.
Application Install Example
-
Push the APK to the device:
adb push /sdcard/example.apk -
Get an auth token using
getEloAccessToken. -
Install the application using
silentPackageInstall.- The process may take up to a minute.
- An install listener will receive status updates.
- The installation listener will be automatically unregistered upon success.
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
Read system property
Parameters
key
- key of system property
Returns
value of system property
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}
enableWhitelistPackages
public boolean enableWhitelistPackages(android.content.Context
context,
java.lang.String json,
android.os.Handler handler)
This method is used to set rules for enabling/disabling packages. This will create a list for the packages that will be enabled/disabled on the device.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if whitelist rule change started successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.enableWhitelistPackages(context, "json", handler);
Log.d(TAG, "OK: enableWhitelistPackages result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: enableWhitelistPackages", e);
}
disableWhitelistPackages
public boolean disableWhitelistPackages(android.content.Context
context,
android.os.Handler handler)
This method is used to disable whitelisting rules for packages.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if whitelist rule change started successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.disableWhitelistPackages(context, handler);
Log.d(TAG, "OK: disableWhitelistPackages result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: disableWhitelistPackages", e);
}
silentPackageInstall
public boolean silentPackageInstall(android.content.Context
context,
java.lang.String accessToken,
java.lang.String uri,
android.os.Handler handler)
This method is used to install an APK silently in background Registers a BroadcastReceiver to notify installation of apk is successful or not.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if package installation started successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.silentPackageInstall(context, "accessToken", "uri", handler);
Log.d(TAG, "OK: silentPackageInstall result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: silentPackageInstall", e);
}
setPackageNameAndPermission
public boolean setPackageNameAndPermission(java.lang.String
packageName,
java.lang.String packagePermission)
This method is used to set Package name and Permission
Parameters
packageName
- PackageName of the application needing permissions
Returns
boolean true if package name and permission set successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setPackageNameAndPermission("packageName", "packagePermission");
Log.d(TAG, "OK: setPackageNameAndPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setPackageNameAndPermission", e);
}
silentPackageUninstall
public boolean silentPackageUninstall(android.content.Context
context,
java.lang.String accessToken,
java.lang.String packageName,
android.os.Handler handler)
This method is used to uninstall package silently in background Registers a listener for the package uninstallation status
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.silentPackageUninstall(context, "accessToken", "packageName", handler);
Log.d(TAG, "OK: silentPackageUninstall result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: silentPackageUninstall", e);
}
stopPackage
public boolean stopPackage(android.content.Context
context,
java.lang.String packageName)
This method is used to stop a running package.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if kill package command was successful, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.stopPackage(context, "packageName");
Log.d(TAG, "OK: stopPackage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: stopPackage", e);
}
disablePackage
public boolean disablePackage(android.content.Context
context,
java.lang.String packageName,
android.os.Handler handler)
This method is used to disable a given package. It will no longer be visible in the app drawer.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if package status change started successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.disablePackage(context, "packageName", handler);
Log.d(TAG, "OK: disablePackage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: disablePackage", e);
}
setSettingsPackageEnabled
public void setSettingsPackageEnabled(android.content.Context
context,
boolean enable,
android.os.Handler handler)
This method is used to enable/disable a settings package(com.android.settings).
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setSettingsPackageEnabled(context, true, handler);
Log.d(TAG, "OK: setSettingsPackageEnabled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setSettingsPackageEnabled", e);
}
enablePackage
public boolean enablePackage(android.content.Context
context,
java.lang.String packageName,
android.os.Handler handler)
This method is used to enable the given package if it is currently installed and is disabled.
Parameters
context
- A context object of the calling Class (Activity/Service).
Returns
boolean true if package status change started successfully, false if input
is invalid
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.enablePackage(context, "packageName", handler);
Log.d(TAG, "OK: enablePackage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: enablePackage", e);
}
getPackageStatus
public int getPackageStatus(java.lang.String packageName)
This method is used to check if a given package is enabled or disabled.
Parameters
packageName
- PackageName of the package user needs to know is enabled or disabled
Returns
int 1 if package is enabled, 0 if package is disabled, -1 if package is not
installed,
-2 if empty package name provided, -3 if package service is not available
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getPackageStatus("packageName");
Log.d(TAG, "OK: getPackageStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getPackageStatus", e);
}
setAppAutostartPinned
public boolean setAppAutostartPinned(java.lang.String
newPassword,
java.lang.String oldPassword,
java.lang.String packageName)
API used to start a task on boot and lock it.
Parameters
newPassword
- new PIN to be set for unpinning an app
Returns
true if the app was successfully pinned, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setAppAutostartPinned("newPassword", "oldPassword", "packageName");
Log.d(TAG, "OK: setAppAutostartPinned result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setAppAutostartPinned", e);
}
removeAppAutostartPinned
public boolean removeAppAutostartPinned(java.lang.String
password,
boolean tempUnlock)
API used to remove starting a task on boot and locking it. User will get unlocked about 2 seconds after this API returns true if tempUnlock is true;
Parameters
password
- device pin required to unlock the task
Returns
true if the app was successfully unpinned, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.removeAppAutostartPinned("password", true);
Log.d(TAG, "OK: removeAppAutostartPinned result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: removeAppAutostartPinned", e);
}getAppAutoStartPinnedStatus
public java.lang.String getAppAutoStartPinnedStatus()
API used to get information if the feature to auto start a task and lock it is currently enabled or not.
Returns
String response: will be in the form of a json string containing the following
keys:
- "isAppPinningEnabled" - Will be true if app auto start and pinning is currently enabled. Will be false if app auto start and pinning is not enabled or if app was permanently unpinned.
- "isAppTemporarilyUnpinned" - Will be true if app is only temporarily unpinned and false if app is currently pinned. This key will not be present in the response if app pinning is not enabled or app was permanently unpinned.
- "pinnedAppPackageName" - Will contain the package name of the app that is currently pinned. This key will not be present in the response if app pinning is not enabled or app was permanently unpinned.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAppAutoStartPinnedStatus();
Log.d(TAG, "OK: getAppAutoStartPinnedStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAppAutoStartPinnedStatus", e);
}
setWhitelistAppPermission
public boolean setWhitelistAppPermission(java.lang.String packageName)
This method used to whitelist the given package. On package installation system will automatically allow runtime permissions for the whitelisted packages. So application doesn't popup runtime permission dialog. After applying change on install time whitelisted package will grant all permissions automatically.
Parameters
packageName
- WhiteListPackageName
Returns
boolean true if package permission whitelist set successfully, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setWhitelistAppPermission("packageName");
Log.d(TAG, "OK: setWhitelistAppPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setWhitelistAppPermission", e);
}
clearWhitelistAppPermission
public boolean clearWhitelistAppPermission(java.lang.String packageName)
This method used to clear whitelisted packages so system don't allow runtime permissions on installation time.
Parameters
packageName
- String
Returns
boolean true if package permission whitelist cleared successfully, false
otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.clearWhitelistAppPermission("packageName");
Log.d(TAG, "OK: clearWhitelistAppPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: clearWhitelistAppPermission", e);
}
clearAllWhitelistAppPermission
public boolean clearAllWhitelistAppPermission(boolean clearAllPackage)
This method used to clear all whitelisted packages so system don't allow runtime permissions on installation time.
Parameters
clearAllPackage
- boolean
Returns
boolean true if package permission whitelist cleared successfully, false
otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.clearAllWhitelistAppPermission(true);
Log.d(TAG, "OK: clearAllWhitelistAppPermission result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: clearAllWhitelistAppPermission", e);
}
unregisterPackageInstallAPIListener
public void unregisterPackageInstallAPIListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the silentPackageInstall(Context, String, String, Handler) API is used in your application. Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of silentPackageInstall(Context, String, String, Handler) API. This ensures the receiver is not leaked.
Parameters
context
- Context in which the Network APIs were used
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unregisterPackageInstallAPIListener(context);
Log.d(TAG, "OK: unregisterPackageInstallAPIListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unregisterPackageInstallAPIListener", e);
}
unregisterPackageUninstallAPIListener
public void unregisterPackageUninstallAPIListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the silentPackageUninstall(Context, String, String, Handler) API is used in your application. Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of silentPackageUninstall(Context, String, String, Handler) API. This ensures the receiver is not leaked.
Parameters
context
- Context in which the Network APIs were used
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unregisterPackageUninstallAPIListener(context);
Log.d(TAG, "OK: unregisterPackageUninstallAPIListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unregisterPackageUninstallAPIListener", e);
}
unregisterPackageStatusChangeListener
public void unregisterPackageStatusChangeListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when using the enablePackage(Context, String, Handler) and disablePackage(Context, String, Handler) APIs in your application. Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of any of these two APIs. This ensures the receiver is not leaked.
Parameters
context
- Context in which the Network APIs were used
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unregisterPackageStatusChangeListener(context);
Log.d(TAG, "OK: unregisterPackageStatusChangeListener result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unregisterPackageStatusChangeListener", e);
}
bindService
public void bindService(android.content.Context
context, ServiceConnectionCallback
callback,
java.lang.String accessToken)
This method is used to bind the service to the application. Use this method to bind the service to the application before using any of the APIs.
Parameters
context
- Context in which the Network APIs were used
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}Peripherals APIs
Peripheral
The PeripheralManager class provides the following operations:
- Retrieve an authentication token using getEloAccessToken().
- Enable or disable device ports using a JSON configuration string. Currently, only USB ports can be controlled using setUSBPorts(String).
- Read the current USB port status in JSON format using getUSBPorts().
- Get the maximum number of USB ports supported by the device model using getMaxUSBPort().
- Start USB monitoring, which resets USB Debug mode to host mode and enables USB ports, using startUsbMonitoring().
- Stop USB monitoring using stopUsbMonitoring().
- Retrieve attached USB device information using getAttachedPeripheralDetails().
- Read a system property using readSystemProperty(String).
bindService
public void bindService(android.content.Context
context, ServiceConnectionCallback
callback,
java.lang.String accessToken)
This method is used to bind the service to the application. Use this method to bind the service to the application before using any of the APIs.
Parameters
context
- Context in which the Network APIs were used
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
unbindService
public void unbindService(android.content.Context context)
This method is used to unbind the Peripheral Service. Use this method to unbind from the service when clearing resources.
Parameters
context
- The context of the application
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unbindService(context);
Log.d(TAG, "OK: unbindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unbindService", e);
}
setUSBPorts
public boolean setUSBPorts(java.lang.String json)
This method is used to enable/disable the USB ports on the device.
Parameters
json
- A json string containing configuration of USB ports to be set
Returns
true if the USB ports were set successfully, false otherwise
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.setUSBPorts("json");
Log.d(TAG, "OK: setUSBPorts result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: setUSBPorts", e);
}
getUSBPorts
public java.lang.String getUSBPorts()
This method is used to get status of the USB ports on the device.
Returns
A json string containing the status of the USB ports
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getUSBPorts();
Log.d(TAG, "OK: getUSBPorts result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getUSBPorts", e);
}
getMaxUSBPort
public int getMaxUSBPort()
This method is used to get the maximum number of USB ports on the device. TODO: Obtain the max USB ports for specific device from EloSecure MODEL specific condition should not be a part common application
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMaxUSBPort();
Log.d(TAG, "OK: getMaxUSBPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMaxUSBPort", e);
}
getMaxExtUSBPort
public int getMaxExtUSBPort(android.content.Context ctx)
TODO: Obtain the max USB ports for specific device from EloSecure
Parameters
ctx
-
Returns
maxExtPorts - Maximum ports for attached hub type
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMaxExtUSBPort(context);
Log.d(TAG, "OK: getMaxExtUSBPort result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMaxExtUSBPort", e);
}
startUsbMonitoring
public void startUsbMonitoring()
This method is used to start USB Monitoring. It will reset USB Debug mode to host mode from device mode. It will enable the USB ports.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.startUsbMonitoring();
Log.d(TAG, "OK: startUsbMonitoring result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: startUsbMonitoring", e);
}
stopUsbMonitoring
public void stopUsbMonitoring()
This method is used to stop USB Monitoring.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.stopUsbMonitoring();
Log.d(TAG, "OK: stopUsbMonitoring result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: stopUsbMonitoring", e);
}
getAttachedPeripheralDetails
public org.json.JSONObject getAttachedPeripheralDetails()
This method is used to get attached usb device information
Returns
JSONObject of Usb Port Information
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAttachedPeripheralDetails();
Log.d(TAG, "OK: getAttachedPeripheralDetails result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAttachedPeripheralDetails", e);
}
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
This method is used to read system property
Parameters
key
- System property key
Returns
System property value
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}
getAllUsbAudioDevices
public java.util.List<java.lang.String> getAllUsbAudioDevices()
This method is used to get all usb audio devices. It returns a list of Stringified JSON Objects, which have 2 keys: "DeviceName" - String, and "CardNumber" - Integer. The "CardNumber" is what identifies the device, and can be used with setUsbAudioDevice API
Returns
List of Stringified JSON Objects representing all available USB Audio Devices
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAllUsbAudioDevices();
Log.d(TAG, "OK: getAllUsbAudioDevices result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAllUsbAudioDevices", e);
}
getUsbAudioDevice
public int getUsbAudioDevice()
This method is used to get the current usb audio device in use.
Returns
Integer representing the current usb audio device identifier. This is the
"CardNumber"
referenced in
getAllUsbAudioDevices
If no device is in use, -1 is returned
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getUsbAudioDevice();
Log.d(TAG, "OK: getUsbAudioDevice result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getUsbAudioDevice", e);
}OTA / Updates APIs
OTA
OTA class allows you to download and install OS upgrade files securely.
OS Upgrade Example:
- Get an auth token using getEloAccessToken
- Check if new updates are available using checkEloOTAStatus. The OTA_CHECK_STATUS_NEW flag indicates a new update.
- (Not for Android Q) Download the new OS using startDownloadEloOTAPackage.
- Download progress callbacks are received with OTA_DOWNLOAD_REMOTE_FILE_PERCENTAGE.
- Successful download is indicated by OTA_DOWNLOAD_REMOTE_FILE_SUCCESS.
- (Only for Android Q) Download, verify, and install using downloadApplyABOTA.
startDownloadUpgradePackage
public void startDownloadUpgradePackage(android.content.Context
context,
java.lang.String accessToken,
java.lang.String otaURL,
android.net.Uri uri,
java.lang.String otaVersion,
android.os.Handler handler)
This method is used to download OTA file from remote http server or from local file path. A token is required prior to calling this function.
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.startDownloadUpgradePackage(context, "accessToken", "otaURL", uri, "otaVersion", handler);
Log.d(TAG, "OK: startDownloadUpgradePackage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: startDownloadUpgradePackage", e);
}
downloadApplyABOTA
public void downloadApplyABOTA(android.content.Context
context,
java.lang.String accessToken,
java.lang.String otaURL,
java.lang.String otaPath,
java.lang.String otaVersion,
android.os.Handler handler)
This method is used to download, verify, and apply an OTA update.
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.downloadApplyABOTA(context, "accessToken", "otaURL", "otaPath", "otaVersion", handler);
Log.d(TAG, "OK: downloadApplyABOTA result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: downloadApplyABOTA", e);
}
getAvailableVersions
public void getAvailableVersions(android.content.Context
context,
java.lang.String accessToken,
AndroidVersion androidVersion,
android.os.Handler handler)
This method retrieves available OTA versions from the server.
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getAvailableVersions(context, "accessToken", androidVersion, handler);
Log.d(TAG, "OK: getAvailableVersions result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getAvailableVersions", e);
}
getOS360Details
public void getOS360Details(android.content.Context
context,
java.lang.String accessToken,
android.os.Handler handler)
This method is used to retrieve OS360 subscription details.
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getOS360Details(context, "accessToken", handler);
Log.d(TAG, "OK: getOS360Details result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getOS360Details", e);
}
checkOTAStatus
public void checkOTAStatus(android.content.Context
context,
java.lang.String accessToken,
java.lang.String buildPropUrl,
android.os.Handler handler)
This method checks whether the currently installed OTA is newer or older than the latest available.
Parameters
context
- A context object of the calling Class (Activity/Service).
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.checkOTAStatus(context, "accessToken", "buildPropUrl", handler);
Log.d(TAG, "OK: checkOTAStatus result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: checkOTAStatus", e);
}Info / Diagnostics APIs
Info
Info class provides device related information. It provides the below operations:
- Get device information using getDeviceInfo.
- If the device is in Android home mode, this method gives information such as MODEL, SERIAL, PRODUCT, DEVICE, MANUFACTURER, BOARD, BRAND, ID, and DISPLAY in JSON format.
- If the device is in EloView mode and online, additional fields include "parent_account", "state_province", "site_name", "device_name", "address_line_1", "postal_code", "country", "city", "group_name".
- Register for device info updates using registerDeviceInfoReceiver.
- Unregister using unregisterDeviceInfoReceiver.
- Get SDK version using getSDKVersion.
- Check SDK support using isSDKSupported.
- Check if a package is installed using isPackageInstalled.
- Read system properties using readSystemProperty.
bindService
public void bindService(android.content.Context context, ServiceConnectionCallback callback, java.lang.String accessToken)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
unbindService
public void unbindService(android.content.Context context)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unbindService(context);
Log.d(TAG, "OK: unbindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unbindService", e);
}
isPackageInstalled
public boolean isPackageInstalled(java.lang.String pkgName)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isPackageInstalled("pkgName");
Log.d(TAG, "OK: isPackageInstalled result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isPackageInstalled", e);
}
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}
getSDKVersion
public java.lang.String getSDKVersion()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getSDKVersion();
Log.d(TAG, "OK: getSDKVersion result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getSDKVersion", e);
}
isSDKSupported
public boolean isSDKSupported()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isSDKSupported();
Log.d(TAG, "OK: isSDKSupported result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isSDKSupported", e);
}
getDeviceInfo
public org.json.JSONObject getDeviceInfo()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getDeviceInfo();
Log.d(TAG, "OK: getDeviceInfo result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getDeviceInfo", e);
}
getSystemCpuUsage
public org.json.JSONObject getSystemCpuUsage()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getSystemCpuUsage();
Log.d(TAG, "OK: getSystemCpuUsage result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getSystemCpuUsage", e);
}
registerDeviceInfoReceiver
public int registerDeviceInfoReceiver(android.content.Context ctx, android.content.BroadcastReceiver deviceInfoReceiver)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.registerDeviceInfoReceiver(context, deviceInfoReceiver);
Log.d(TAG, "OK: registerDeviceInfoReceiver result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: registerDeviceInfoReceiver", e);
}Memory APIs
Memory
Memory class provides information regarding the device memory. It provides the following operations:
- Get memory information such as total memory, available memory, and low-memory state using getMemoryInfo.
- Read system properties using readSystemProperty.
bindService
public void bindService(android.content.Context context, ServiceConnectionCallback callback, java.lang.String accessToken)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.bindService(context, callback, "accessToken");
Log.d(TAG, "OK: bindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: bindService", e);
}
unbindService
public void unbindService(android.content.Context context)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.unbindService(context);
Log.d(TAG, "OK: unbindService result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: unbindService", e);
}
readSystemProperty
public java.lang.String readSystemProperty(java.lang.String key)
This method is used to read the system property.
Parameters
- key – String system property key
Returns
String system property value
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.readSystemProperty("key");
Log.d(TAG, "OK: readSystemProperty result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: readSystemProperty", e);
}Constants APIs
Consts
Provides helper methods for device identification, migration state checks, and Elo-specific intent creation.
isDevice7Inch
public static boolean isDevice7Inch()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isDevice7Inch();
Log.d(TAG, "OK: isDevice7Inch result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isDevice7Inch", e);
}
isDeviceM100
public static boolean isDeviceM100()
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.isDeviceM100();
Log.d(TAG, "OK: isDeviceM100 result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: isDeviceM100", e);
}
getMigrate
public org.json.JSONObject getMigrate(android.content.Context context)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getMigrate(context);
Log.d(TAG, "OK: getMigrate result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getMigrate", e);
}
getEloIntentWithFlag
public android.content.Intent getEloIntentWithFlag(android.content.Context context, java.lang.String token, java.lang.String action)
Example
try {
// TODO: ensure service is bound before calling SDK APIs
Object result = sdk.getEloIntentWithFlag(context, "token", "action");
Log.d(TAG, "OK: getEloIntentWithFlag result=" + result);
} catch (Exception e) {
Log.e(TAG, "FAIL: getEloIntentWithFlag", e);
}
Please report any broken links by emailing support@elotouch.com and include a link to the knowledge article