AsReader

getInstance

Method Name

public static AsReader getInstance()

Return Value

Type

Description

AsReader

Singleton object

Description

Creates a singleton AsReader object.

Sample Code

AsReader asReader = AsReader.getInstance();

getDeviceManager

Method Name

public DeviceManager getDeviceManager()

Return Value

Type

Description

DeviceManager

Returns the singleton DeviceManager object

Description

Retrieves the DeviceManager object.

Sample Code

DeviceManager deviceManager = AsReader.getInstance().getDeviceManager();

getBarcodeManager

Method Name

public BarcodeManager getBarcodeManager()

Return Value

Type

Description

BarcodeManager

Returns the singleton BarcodeManager object

Description

Retrieves the BarcodeManager object.

Sample Code

BarcodeManager barcodeManager = AsReader.getInstance().getBarcodeManager();

getVersion

Method Name

public String getVersion()

Return Value

Type

Description

String

SDK version

Description

Gets the SDK version.

Sample Code

String version = AsReader.getInstance().getVersion();

initialize(Context context, ConnectionType connectionType)

Method Name

public void initialize(Context context, ConnectionType connectionType)

Parameters

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

AsReader.getInstance().initialize(getApplicationContext(), ConnectionType.USB);

setLogLevel

Method Name

public void setLogLevel(LogLevel level)

Parameters

Parameter

Type

Description

level

LogLevel

LogLevel

Description

Sets the log level.

Sample Code

AsReader.getInstance().setLogLevel(LogLevel.Debug);

getLogLevel

Method Name

public LogLevel getLogLevel()

Return Value

Type

Description

LogLevel

LogLevel

Description

Retrieves the current log level.

Sample Code

LogLevel level = AsReader.getInstance().getLogLevel();

setLog

Method Name

public void setLog(boolean enable)

Parameters

Parameter

Type

Description

enable

boolean

Whether to output logs:
true: enable logging
false: disable logging

Description

Configures whether logs should be output.

Sample Code

AsReader.getInstance().setLog(true);

removeSDKLog

Method Name

public void removeSDKLog()

Description

Deletes all log files.

Sample Code

AsReader.getInstance().removeSDKLog();

enableAutoLaunchApp

Method Name

public void enableAutoLaunchApp(boolean enable, String aliasName)

Parameters

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

AsReader.getInstance().enableAutoLaunchApp(false, "MainActivityAlias");