System Util
A utility class that binds to a generic service to provide access to INI configuration and device information. This class manages its own service connection lifecycle and ensures safe access by returning default values until the service is connected. Integrators can register a callback to be notified when the service is ready.
Example usage with setObserver:
SystemUtil systemUtil = new SystemUtil(context);
SystemUtil.setObserver(activity, isReady -> {
if (isReady) {
String mac = systemUtil.getMacAddress();
String serial = serviceUtil.getSerialNumber();
Log.d("Client", "Service ready - MAC: " + mac + ", Serial: " + serial);
} else {
Log.d("Client", "Service not ready yet");
}
});
Content copied to clipboard
Constructors
Functions
Link copied to clipboard
Retrieves the device's MAC address from the service.
Link copied to clipboard
Retrieves the device's serial number from the service.
Link copied to clipboard
Removes a previously registered observer from monitoring the service connection state.
Link copied to clipboard
Registers an observer to monitor the service connection state.