-
public final class ValidicOCRController
ValidicOCRController is the primary interface for getting records via OCR. The live results and final record are given to the ValidicOCRResultListener object registered by calling setListener.
The controller is initialized with a OCRPeripheral object. A OCRPeripheral object can be obtained by calling getSupportedPeripherals or if you know the peripheral id: getPeripheralForID.
The recognition process involves a fragment that contains the camera preview and an overlay image. The fragment must be injected into your view to operate by calling injectOCRFragment. Be sure to commit the transaction returned! OCR processing begins (and therefore callbacks begin) as soon as the fragment is injected into the view. The camera capture session ends when the fragment is paused or converges on a final result. The ocr session may be restarted at any point by calling restartOCR
-
-
Method Summary
Modifier and Type Method Description static ValidicOCRController
initWithPeripheralId(int peripheralID)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. static ValidicOCRController
initWithPeripheralId(int peripheralID, Unit.Glucose unit)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. static ValidicOCRController
initWithPeripheralId(int peripheralID, Unit.Temperature unit)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. static ValidicOCRController
initWithOCRPeripheralType(int typeOfOCRPeripheral)
Given the getOcrPeripheralType, we will instantiate an ocr controller. static ValidicOCRController
initWithOCRPeripheralType(int typeOfOCRPeripheral, Unit.Glucose unit)
Given the getOcrPeripheralType, we will instantiate an ocr controller. static ValidicOCRController
initWithOCRPeripheral(OCRPeripheral peripheral)
Given the OCRPeripheral, we will instantiate an ocr controller. static ValidicOCRController
initWithOCRPeripheral(OCRPeripheral peripheral, Unit.Glucose unit)
Given the OCRPeripheral, we will instantiate an ocr controller. static ValidicOCRController
initWithOCRPeripheral(OCRPeripheral peripheral, Unit.Temperature unit)
FragmentTransaction
injectOCRFragment(FragmentTransaction fragTransaction, int viewID)
Given a FragmentTransaction and {@code viewID}
, we will inject a fragment into the view.void
setListener(ValidicOCRResultListener listener)
Register or unregister a ValidicOCRResultListener to receive ocr events. void
restartOCR()
Restart the ocr process. -
-
Method Detail
-
initWithPeripheralId
static ValidicOCRController initWithPeripheralId(int peripheralID)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithPeripheralId
static ValidicOCRController initWithPeripheralId(int peripheralID, Unit.Glucose unit)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithPeripheralId
static ValidicOCRController initWithPeripheralId(int peripheralID, Unit.Temperature unit)
Given the OCRPeripheral peripheralID, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithOCRPeripheralType
static ValidicOCRController initWithOCRPeripheralType(int typeOfOCRPeripheral)
Given the getOcrPeripheralType, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithOCRPeripheralType
static ValidicOCRController initWithOCRPeripheralType(int typeOfOCRPeripheral, Unit.Glucose unit)
Given the getOcrPeripheralType, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithOCRPeripheral
static ValidicOCRController initWithOCRPeripheral(OCRPeripheral peripheral)
Given the OCRPeripheral, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithOCRPeripheral
static ValidicOCRController initWithOCRPeripheral(OCRPeripheral peripheral, Unit.Glucose unit)
Given the OCRPeripheral, we will instantiate an ocr controller. Afterwards call injectOCRFragment to begin capturing.
-
initWithOCRPeripheral
static ValidicOCRController initWithOCRPeripheral(OCRPeripheral peripheral, Unit.Temperature unit)
-
injectOCRFragment
FragmentTransaction injectOCRFragment(FragmentTransaction fragTransaction, int viewID)
Given a FragmentTransaction and
{@code viewID}
, we will inject a fragment into the view. Afterwards you mast call commit to finalize the injection. The same FragmentTransaction is returned to allow for chaining.Example:
{@code * * validicOCRController.injectOCRFragment( getFragmentManager().beginTransaction(), * R.id.ocr_fragment_container) * .commit(); * }
-
setListener
void setListener(ValidicOCRResultListener listener)
Register or unregister a ValidicOCRResultListener to receive ocr events.
-
restartOCR
void restartOCR()
Restart the ocr process.
-
-
-
-