Package com.casioeurope.mis.edt
Class SystemLibrary
Object
SystemLibrary
public class SystemLibrary extends Object
The CASIO Enterprise Developer Tools System Library
- Since:
- 2.00
- API Note:
- The System Library is bound to the calling application on application startup time automatically.
The Library's lifecycle therefore depends on the application lifecycle.
Due to the Lifecycle of Android Applications and the underlying timing, it is strongly advised not to call any Library Methods inside theonCreate
method.
When the activity is being launched (and hence the process gets created), the same applies to theonStart
andonResume
methods.
If you need to call any Library methods at application start in one of the above mentioned methods, you should use theCallback
Mechanism offered by theonLibraryReady
method instead.
For instance, instead of callingSystemLibrary.setNavigationBarState(false)
directly inonCreate
, use this code to postpone it to aCallback
appropriately:
SystemLibrary.onLibraryReady(new LibraryCallback() { public void onLibraryReady() { SystemLibrary.setNavigationBarState(false); } });
Which can be simplified to:
SystemLibrary.onLibraryReady(() -> { SystemLibrary.setNavigationBarState(false); });
-
Method Summary
Modifier and Type Method Description static String
getCASIOSerial()
Get the Serial NumberString
of your CASIO devicestatic String
getModelName()
Get the Model NameString
of your CASIO devicestatic boolean
getNavigationBarState()
Get the Visibility State of the Navigation Barstatic boolean
isMethodSupported(String methodName)
static boolean
isMethodSupported(BigInteger method)
Check whether theMethod
indicated by theBigInteger
method parameter is supported on the currently active devicestatic void
onLibraryReady(LibraryCallback callback)
Add a new Callback to the Queue of Callbacks to be processed once the System Library Service becomes availablestatic void
setNavigationBarState(boolean state)
Set the Visibility State of the Navigation Bar
-
Method Details
-
getCASIOSerial
public static String getCASIOSerial() throws RemoteException, UnsupportedOperationException, IllegalStateExceptionGet the Serial NumberString
of your CASIO device- Returns:
String
: The Serial Number of your CASIO device- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getModelName
public static String getModelName() throws RemoteException, UnsupportedOperationException, IllegalStateExceptionGet the Model NameString
of your CASIO device- Returns:
String
: The Model Name of your CASIO device- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getNavigationBarState
public static boolean getNavigationBarState() throws RemoteException, UnsupportedOperationException, IllegalStateExceptionGet the Visibility State of the Navigation Bar- Returns:
boolean
: Whether or not the Navigation Bar is visible- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
setNavigationBarState
public static void setNavigationBarState(boolean state) throws RemoteException, UnsupportedOperationExceptionSet the Visibility State of the Navigation Bar- Parameters:
state
-boolean
: Whether or not the Navigation Bar shall be visible- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.
-
isMethodSupported
Check whether theMethod
indicated by theBigInteger
method parameter is supported on the currently active device- Parameters:
method
-BigInteger
: Constant referencing the method to be checked- Returns:
boolean
:true
if the method is supported on the currently active device, otherwisefalse
- Throws:
IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
isMethodSupported
Check whether theMethod
indicated by theString
methodName parameter is supported on the currently active device- Parameters:
methodName
-String
: Name of the method to be checked- Returns:
boolean
:true
if the method is supported on the currently active device, otherwisefalse
- Throws:
IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
onLibraryReady
public static void onLibraryReady(LibraryCallback callback) throws RemoteException, UnsupportedOperationExceptionAdd a new Callback to the Queue of Callbacks to be processed once the System Library Service becomes available- Parameters:
callback
-LibraryCallback
: Instance of theLibraryCallback
Interface which holds theonLibraryReady()
Method which will get called once the regarding library becomes available- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.
-