public class BarcodeManager extends EMDKBase
When using BarcodeManager consider the followings:Example Usage: public class MainActivity extends Activity implements EMDKListener, StatusListener, DataListener, ScannerConnectionListener { //@Override protected void onCreate(Bundle savedInstanceState) { //... EMDKResults results = EMDKManager.getEMDKManager(getApplicationContext(), this); } //@Override public void onOpened(EMDKManager emdkManager) { this.emdkManager = emdkManager; //... barcodeManager = (BarcodeManager)this.emdkManager.getInstance(FEATURE_TYPE.BARCODE); //... Scanner scanner = barcodeManager.getDevice(DeviceIdentifier.DEFAULT); scanner.addDataListener(callbackObj); scanner.addStatusListener(callbackObj); scanner.enable(); //... scanner.read(); //... scanner.cancelRead(); //... scanner.disable(); //.. EMDKManager.release(FEATURE_TYPE.BARCODE); } }
Modifier and Type | Class and Description |
---|---|
static class |
BarcodeManager.ConnectionState
Connection states of a scanner device.
|
static class |
BarcodeManager.DeviceIdentifier
Defines specific scanner devices of each type.
|
static interface |
BarcodeManager.ScannerConnectionListener
An interface for notifying client applications when the external scanner
is connected or disconnected to the mobile device.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(BarcodeManager.ScannerConnectionListener connectionListener)
Add ScannerConnectionListener to receive scanner connection changes via
callback.
|
Scanner |
getDevice(BarcodeManager.DeviceIdentifier deviceIdentifier)
This method returns the scanner object based on device identifier specified except DeviceIdentifier.UNDEFINED.
|
Scanner |
getDevice(ScannerInfo scannerInfo)
This method returns the scanner object if the scanner info specified is valid
and scanner info object can obtain from the BarcoderManager.getSupportedDevices().
|
java.util.List<ScannerInfo> |
getSupportedDevicesInfo()
Returns list of supported scanner devices information.
|
void |
removeConnectionListener(BarcodeManager.ScannerConnectionListener connectionListener)
Remove ScannerConnectionListener to receive scanner connection changes
via callback.
|
public java.util.List<ScannerInfo> getSupportedDevicesInfo()
ScannerException
public Scanner getDevice(ScannerInfo scannerInfo)
friendlyName
- The scanner friendly name.public Scanner getDevice(BarcodeManager.DeviceIdentifier deviceIdentifier)
This method returns the scanner object based on device identifier specified except DeviceIdentifier.UNDEFINED. The scanner object created will be singleton object for a specific scanner.
deviceIdentifier
- The device identifier specifies which scanner the application wants.Scanner
object if the device identifier specified is valid on the device. Otherwise null is returned.public void addConnectionListener(BarcodeManager.ScannerConnectionListener connectionListener)
connectionListener
- public void removeConnectionListener(BarcodeManager.ScannerConnectionListener connectionListener)
connectionListener
-