java.lang.Object | ||
↳ | com.neomades.ui.View | |
↳ | com.neomades.barcode.BarcodeScannerView |
View directly linked with the camera that scans for bar codes.
Use setBarcodeScanner(BarcodeScanner)
to define what kind of bar
code to track and to perform customized action when a bar code has been
detected.
By default, a BarcodeScannerView has a configured BarcodeScanner
to
track QR-Code. The action to perform when a QR-Code is found can be changed
by setting a BarcodeListener
on the default scanner.
The BarcodeScanner (and thus the camera that performs the scan) must be
manually started using startBarcodeScanner()
. Without that, the
camera will not start and the view will remain empty. Avoid to call
startBarcodeScanner()
during the onCreate()
method of
the screen, it may result in unexpected behaviors.
In the same way, the BarcodeScanner must be stopped before exiting the
screen. The best way to do that is to call stopBarcodeScanner()
in
the onPause()
method of the screen.
The BarcodeScanner automatically stops when a bar code is detected. To
restart the scan, a call to startBarcodeScanner()
must be done.
[Expand]
Inherited XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BarcodeScannerView() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BarcodeScanner |
getBarcodeScanner()
Returns the BarcodeScanner of this view.
| ||||||||||
void |
setBarcodeScanner(BarcodeScanner scanner)
Associates a
BarcodeScanner with this view. | ||||||||||
void |
startBarcodeScanner()
Starts the camera to track bar codes.
| ||||||||||
void |
stopBarcodeScanner()
Stops the camera tracking.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Returns the BarcodeScanner of this view.
By default, the view has a BarcodeScanner configured to track for QR-Code.
Associates a BarcodeScanner
with this view.
This will indicate to the camera what kind of bar code to track and what to do when found.
scanner | a BarcodeScanner |
---|
Starts the camera to track bar codes. The scan should be started in the
onResume()
method of the screen that contains this view.
Stops the camera tracking. The scan should be stopped in the
onPause()
method of the screen that contains this view.