public class BarcodeManager
extends java.lang.Object
Manage service @see com.famoco.barcode.BarcodeManagerService
| Modifier and Type | Field | Description |
|---|---|---|
static int |
INPUT_METHOD_INTENT |
Sends the barcode to the foreground app as an intent
|
static int |
INPUT_METHOD_KEY |
Inputs characters one by one as key input events
|
static int |
INPUT_METHOD_PASTE |
Inputs the barcode as a whole as a clipboard paste event
|
| Constructor | Description |
|---|---|
BarcodeManager(com.famoco.barcode.IBarcodeManager service) |
| Modifier and Type | Method | Description |
|---|---|---|
static BarcodeManager |
getInstance(android.content.Context context) |
Gets the BarcodeManager instance to manage the barcode manager service.
|
boolean |
isActive() |
Returns whether the barcode scanner service is active.
|
void |
open() |
Opens the barcode scanner service.
|
void |
pause() |
Pauses barcode scanner service.
|
void |
release() |
Releases the barcode scanner service.
|
void |
resume() |
Resumes barcode scanner service.
|
void |
setButtonKeycodes(java.lang.String buttonKeycodesList) |
Set button keycodes to trigger a barcode laser scan.
|
void |
setEnabled(boolean enabled) |
Enable/disable barcode scanner service.
|
void |
setInputMethod(int inputMethod) |
Set inputMethod scan action to execute after a barcode laser scan.
|
void |
setPostScanAction(int postScanAction) |
Set post scan action to execute after a barcode laser scan.
|
void |
setScanning(boolean enabled) |
Start/stop a single scan.
|
void |
setSoundEnabled(boolean enabled) |
Enable/disable sound
|
public static int INPUT_METHOD_KEY
public static int INPUT_METHOD_PASTE
public static int INPUT_METHOD_INTENT
public BarcodeManager(com.famoco.barcode.IBarcodeManager service)
public static BarcodeManager getInstance(android.content.Context context)
public void release()
pause() is preferred in most use cases.public boolean isActive()
true if the service is activepublic void open()
public void pause()
resume().public void resume()
pause().public void setEnabled(boolean enabled)
enabled - whether to enable or disable the barcode scanner service.public void setScanning(boolean enabled)
enabled - whether to start or stop the scan.public void setSoundEnabled(boolean enabled)
enabled - whether to enable or disable the sound in barcode scanner service.public void setButtonKeycodes(java.lang.String buttonKeycodesList)
buttonKeycodesList - list of button keycodes ids separated by commas.java.lang.IllegalArgumentException - if the buttonKeycodes is invalid.public void setPostScanAction(int postScanAction)
postScanAction - action to execute after a barcode laser scan.java.lang.IllegalArgumentException - if the post scan action is invalid.public void setInputMethod(int inputMethod)
inputMethod - : one of INPUT_METHOD_KEY, INPUT_METHOD_PASTE or INPUT_METHOD_INTENTjava.lang.IllegalArgumentException - if the input method is invalid.