# AsReader ## getInstance ### Method Name ```java public static AsReader getInstance() ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - AsReader - Singleton object ``` ### Description Creates a singleton `AsReader` object. ### Sample Code ```java AsReader asReader = AsReader.getInstance(); ``` --- ## getDeviceManager ### Method Name ```java public DeviceManager getDeviceManager() ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - DeviceManager - Returns the singleton [DeviceManager](DeviceManager.md) object ``` ### Description Retrieves the `DeviceManager` object. ### Sample Code ```java DeviceManager deviceManager = AsReader.getInstance().getDeviceManager(); ``` --- ## getBarcodeManager ### Method Name ```java public BarcodeManager getBarcodeManager() ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - BarcodeManager - Returns the singleton [BarcodeManager](barcodeManager.md) object ``` ### Description Retrieves the `BarcodeManager` object. ### Sample Code ```java BarcodeManager barcodeManager = AsReader.getInstance().getBarcodeManager(); ``` --- ## getVersion ### Method Name ```java public String getVersion() ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - String - SDK version ``` ### Description Gets the SDK version. ### Sample Code ```java String version = AsReader.getInstance().getVersion(); ``` --- ## initialize(Context context, ConnectionType connectionType) ### Method Name ```java public void initialize(Context context, ConnectionType connectionType) ``` ### Parameters ```{list-table} :align: left :class: list-table * - Parameter - Type - Description * - context - Context - Application context * - connectionType - ConnectionType - Type of connection ``` ### Description Initializes the SDK with the specified context and connection type. ### Sample Code ```java AsReader.getInstance().initialize(getApplicationContext(), ConnectionType.USB); ``` --- ## setLogLevel ### Method Name ```java public void setLogLevel(LogLevel level) ``` ### Parameters ```{list-table} :align: left :class: list-table * - Parameter - Type - Description * - level - LogLevel - [LogLevel](LogLevel.md#loglevel) ``` ### Description Sets the log level. ### Sample Code ```java AsReader.getInstance().setLogLevel(LogLevel.Debug); ``` --- ## getLogLevel ### Method Name ```java public LogLevel getLogLevel() ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - LogLevel - [LogLevel](LogLevel.md#loglevel) ``` ### Description Retrieves the current log level. ### Sample Code ```java LogLevel level = AsReader.getInstance().getLogLevel(); ``` --- ## setLog ### Method Name ```java public void setLog(boolean enable) ``` ### Parameters ```{list-table} :align: left :class: list-table * - Parameter - Type - Description * - enable - boolean - Whether to output logs: true: enable logging false: disable logging ``` ### Description Configures whether logs should be output. ### Sample Code ```java AsReader.getInstance().setLog(true); ``` --- ## removeSDKLog ### Method Name ```java public void removeSDKLog() ``` ### Description Deletes all log files. ### Sample Code ```java AsReader.getInstance().removeSDKLog(); ``` --- ## enableAutoLaunchApp ### Method Name ```java public void enableAutoLaunchApp(boolean enable, String aliasName) ``` ### Parameters ```{list-table} :align: left :class: list-table * - Parameter - Type - Description * - enable - boolean - Set whether to automatically launch the demo app when connecting to M24D: true: auto-launch false: do not auto-launch * - aliasName - String - Activity alias name ``` ### Description Configures whether the app should automatically launch when connecting to an M24D device. ### Sample Code ```java AsReader.getInstance().enableAutoLaunchApp(false, "MainActivityAlias"); ```