Package com.google.zxing.client.android
Class Intents.Scan
- java.lang.Object
-
- com.google.zxing.client.android.Intents.Scan
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTIONSend this intent to open the Barcodes app in scanning mode, find a barcode, and return the results.static StringAZTEC_MODEDecode only Aztec.static StringBARCODE_IMAGE_ENABLEDSet to true to return a path to the barcode's image as it was captured.static StringBEEP_ENABLEDSet to false to disable beep.static StringCAMERA_IDOptional parameter to specify the id of the camera from which to recognize barcodes.static StringCHARACTER_SETstatic StringDATA_MATRIX_MODEDecode only Data Matrix codes.static StringFORMATSComma-separated list of formats to scan for.static intINVERTED_SCANThe scan should be inverted.static StringMISSING_CAMERA_PERMISSIONSet the time to finish the scan screen.static StringMISSING_CAMERA_PERMISSION_DIALOG_MESSAGESet the time to finish the scan screen.static intMIXED_SCANScan alternating inverted and normal barcodes.static StringMODEBy default, sending this will decode all barcodes that we understand.static intNORMAL_SCANScan normal barcodes white on blackstatic StringONE_D_MODEDecode only 1D barcodes.static StringORIENTATION_LOCKEDWhether or not the orientation should be locked when the activity is first started.static StringPDF417_MODEDecode only PDF417.static StringPRODUCT_MODEDecode only UPC and EAN barcodes.static StringPROMPT_MESSAGEPrompt to show on-screen when scanning by intent.static StringQR_CODE_MODEDecode only QR codes.static StringRESULTIf a barcode is found, Barcodes returnsActivity.RESULT_OKtoActivity.onActivityResult(int, int, android.content.Intent)of the app which requested the scan viaActivity.startActivityForResult(android.content.Intent, int)The barcodes contents can be retrieved withIntent.getStringExtra(String).static StringRESULT_BARCODE_IMAGE_PATHCallIntent.getStringExtra(String)withRESULT_BARCODE_IMAGE_PATHto get aStringpath to a cropped and compressed png file of the barcode's image as it was displayed.static StringRESULT_BYTE_SEGMENTS_PREFIXPrefix for keys that map to the values ofResultMetadataType.BYTE_SEGMENTS, if available.static StringRESULT_BYTESCallIntent.getByteArrayExtra(String)withRESULT_BYTESto get abyte[]of raw bytes in the barcode, if available.static StringRESULT_ERROR_CORRECTION_LEVELKey for the value ofResultMetadataType.ERROR_CORRECTION_LEVEL, if available.static StringRESULT_FORMATCallIntent.getStringExtra(String)withRESULT_FORMATto determine which barcode format was found.static StringRESULT_ORIENTATIONKey for the value ofResultMetadataType.ORIENTATION, if available.static StringRESULT_UPC_EAN_EXTENSIONCallIntent.getStringExtra(String)withRESULT_UPC_EAN_EXTENSIONto return the content of any UPC extension barcode that was also found.static StringSCAN_TYPEDefine the scan type.static StringSHOW_MISSING_CAMERA_PERMISSION_DIALOGSet the time to finish the scan screen.static StringTIMEOUTSet the time to finish the scan screen.static StringTORCH_ENABLEDOptional parameter to switch the torch on at camera startup.
-
-
-
Field Detail
-
ACTION
public static final String ACTION
Send this intent to open the Barcodes app in scanning mode, find a barcode, and return the results.- See Also:
- Constant Field Values
-
MODE
public static final String MODE
By default, sending this will decode all barcodes that we understand. However it may be useful to limit scanning to certain formats. UseIntent.putExtra(String, String)with one of the values below. Setting this is effectively shorthand for setting explicit formats withFORMATS. It is overridden by that setting.- See Also:
- Constant Field Values
-
PRODUCT_MODE
public static final String PRODUCT_MODE
Decode only UPC and EAN barcodes. This is the right choice for shopping apps which get prices, reviews, etc. for products.- See Also:
- Constant Field Values
-
ONE_D_MODE
public static final String ONE_D_MODE
Decode only 1D barcodes.- See Also:
- Constant Field Values
-
QR_CODE_MODE
public static final String QR_CODE_MODE
Decode only QR codes.- See Also:
- Constant Field Values
-
DATA_MATRIX_MODE
public static final String DATA_MATRIX_MODE
Decode only Data Matrix codes.- See Also:
- Constant Field Values
-
AZTEC_MODE
public static final String AZTEC_MODE
Decode only Aztec.- See Also:
- Constant Field Values
-
PDF417_MODE
public static final String PDF417_MODE
Decode only PDF417.- See Also:
- Constant Field Values
-
FORMATS
public static final String FORMATS
Comma-separated list of formats to scan for. The values must match the names ofBarcodeFormats, e.g.BarcodeFormat.EAN_13. Example: "EAN_13,EAN_8,QR_CODE". This overridesMODE.- See Also:
- Constant Field Values
-
CAMERA_ID
public static final String CAMERA_ID
Optional parameter to specify the id of the camera from which to recognize barcodes. Overrides the default camera that would otherwise would have been selected. If provided, should be an int.- See Also:
- Constant Field Values
-
TORCH_ENABLED
public static final String TORCH_ENABLED
Optional parameter to switch the torch on at camera startup. Enables the torch on camera startup If provided, should be a boolean.- See Also:
- Constant Field Values
-
CHARACTER_SET
public static final String CHARACTER_SET
- See Also:
DecodeHintType.CHARACTER_SET, Constant Field Values
-
BEEP_ENABLED
public static final String BEEP_ENABLED
Set to false to disable beep. Defaults to true.- See Also:
- Constant Field Values
-
BARCODE_IMAGE_ENABLED
public static final String BARCODE_IMAGE_ENABLED
Set to true to return a path to the barcode's image as it was captured. Defaults to false.- See Also:
- Constant Field Values
-
TIMEOUT
public static final String TIMEOUT
Set the time to finish the scan screen.- See Also:
- Constant Field Values
-
MISSING_CAMERA_PERMISSION
public static final String MISSING_CAMERA_PERMISSION
Set the time to finish the scan screen.- See Also:
- Constant Field Values
-
SHOW_MISSING_CAMERA_PERMISSION_DIALOG
public static final String SHOW_MISSING_CAMERA_PERMISSION_DIALOG
Set the time to finish the scan screen.- See Also:
- Constant Field Values
-
MISSING_CAMERA_PERMISSION_DIALOG_MESSAGE
public static final String MISSING_CAMERA_PERMISSION_DIALOG_MESSAGE
Set the time to finish the scan screen.- See Also:
- Constant Field Values
-
ORIENTATION_LOCKED
public static final String ORIENTATION_LOCKED
Whether or not the orientation should be locked when the activity is first started. Defaults to true.- See Also:
- Constant Field Values
-
PROMPT_MESSAGE
public static final String PROMPT_MESSAGE
Prompt to show on-screen when scanning by intent. Specified as aString.- See Also:
- Constant Field Values
-
RESULT
public static final String RESULT
If a barcode is found, Barcodes returnsActivity.RESULT_OKtoActivity.onActivityResult(int, int, android.content.Intent)of the app which requested the scan viaActivity.startActivityForResult(android.content.Intent, int)The barcodes contents can be retrieved withIntent.getStringExtra(String). If the user presses Back, the result code will beActivity.RESULT_CANCELED.- See Also:
- Constant Field Values
-
RESULT_FORMAT
public static final String RESULT_FORMAT
CallIntent.getStringExtra(String)withRESULT_FORMATto determine which barcode format was found. SeeBarcodeFormatfor possible values.- See Also:
- Constant Field Values
-
RESULT_UPC_EAN_EXTENSION
public static final String RESULT_UPC_EAN_EXTENSION
CallIntent.getStringExtra(String)withRESULT_UPC_EAN_EXTENSIONto return the content of any UPC extension barcode that was also found. Only applicable toBarcodeFormat.UPC_AandBarcodeFormat.EAN_13formats.- See Also:
- Constant Field Values
-
RESULT_BYTES
public static final String RESULT_BYTES
CallIntent.getByteArrayExtra(String)withRESULT_BYTESto get abyte[]of raw bytes in the barcode, if available.- See Also:
- Constant Field Values
-
RESULT_ORIENTATION
public static final String RESULT_ORIENTATION
Key for the value ofResultMetadataType.ORIENTATION, if available. CallIntent.getIntArrayExtra(String)withRESULT_ORIENTATION.- See Also:
- Constant Field Values
-
RESULT_ERROR_CORRECTION_LEVEL
public static final String RESULT_ERROR_CORRECTION_LEVEL
Key for the value ofResultMetadataType.ERROR_CORRECTION_LEVEL, if available. CallIntent.getStringExtra(String)withRESULT_ERROR_CORRECTION_LEVEL.- See Also:
- Constant Field Values
-
RESULT_BYTE_SEGMENTS_PREFIX
public static final String RESULT_BYTE_SEGMENTS_PREFIX
Prefix for keys that map to the values ofResultMetadataType.BYTE_SEGMENTS, if available. The actual values will be set under a series of keys formed by adding 0, 1, 2, ... to this prefix. So the first byte segment is under key "SCAN_RESULT_BYTE_SEGMENTS_0" for example. CallIntent.getByteArrayExtra(String)with these keys.- See Also:
- Constant Field Values
-
RESULT_BARCODE_IMAGE_PATH
public static final String RESULT_BARCODE_IMAGE_PATH
CallIntent.getStringExtra(String)withRESULT_BARCODE_IMAGE_PATHto get aStringpath to a cropped and compressed png file of the barcode's image as it was displayed. Only available ifIntentIntegrator.setBarcodeImageEnabled(boolean)is called with true.- See Also:
- Constant Field Values
-
SCAN_TYPE
public static final String SCAN_TYPE
Define the scan type.- See Also:
- Constant Field Values
-
NORMAL_SCAN
public static final int NORMAL_SCAN
Scan normal barcodes white on black- See Also:
- Constant Field Values
-
INVERTED_SCAN
public static final int INVERTED_SCAN
The scan should be inverted. White becomes black, black becomes white.- See Also:
- Constant Field Values
-
MIXED_SCAN
public static final int MIXED_SCAN
Scan alternating inverted and normal barcodes.- See Also:
- Constant Field Values
-
-