STWSupported Device Manager
STWSupportedDeviceManager
Description :
Public Class which handles hardware buttons actions for rugged devices using broadcast receivers. List of device that can be supported by the hardware module is :
- CROSSCALL ACTION X3
- CROSSCALL CORE X3
- CROSSCALL TREKKER X4
- RUGGEAR RG740B
- RUGGEAR RG655
- RUGGEAR RG760
- RUGGEAR RG720
- RUGGEAR RG725
- KYOCERA
- TELO TE590
- TELO M5
- SONIM XP8800
- SONIM XP7700
- ATEX PTE300
- ATEX PTE500
- BITTIUM
- CYRUS
- CYBERTEL
- CAT
Example of use
To add the Support of SWhardware module to your project, include the following line in the dependencies block of your build.gradle file:dependencies { implementation project(':swhardware') }Content copied to clipboardContent copied to clipboardSet<Integer> supportedDeviceNameSet = STWSupportedDeviceManager.getInstance().getAllSupportedDevices(); STWSupportedDeviceManager.getInstance().registerForSupportedDevicesCallback(getContext(), supportedDeviceNameSet, new IDeviceEventCallback() { public boolean shouldHandleActions() { //Code... (return true or false to block/unblock reception of callbacks) return true; } public void onPttButtonPressed() { //Code... } public void onPttButtonReleased() { //Code... } public void onSosButtonPressed() { //Code... } public void onSosButtonReleased() { //Code... } public void onPressNextSwitch() { //Code... } public void onPressPreviousSwitch() { //Code... } });Content copied to clipboardSTWSupportedDeviceManager.getInstance().unregisterForSupportedDevices(getContext());Content copied to clipboard
Functions
Link copied to clipboard
list of supported device names that can be registered for click on buttons events callback
Link copied to clipboard
get the current device configuration
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun registerForSupportedDevicesCallback( @NonNull context: Context, @Nullable supportedHardwareList: Set<Integer>, @Nullable iHardwareActionCallback: IDeviceEventCallback)
Content copied to clipboard
Call this method to register for events related to click on supported devices buttons
Link copied to clipboard
open fun setAutoSupportDeviceConfiguration( @NonNull context: Context, @NonNull packageName: String, @NonNull deviceJsonContent: String, @NonNull configurationJsonContent: String, @NonNull hardwareEventListener: HardwareEventListener)
Content copied to clipboard
Call this method to register for events related to click auto support devices buttons
Link copied to clipboard
open fun unregisterForAutoSupportDeviceConfiguration(@NonNull context: Context)
Content copied to clipboard
Call this method to unregister from events related to click on auto support devices buttons and configuration
Link copied to clipboard
Call this method to unregister from events related to click on supported devices buttons