public class ImagePicker
extends java.lang.Object
IImagePickerCallback
or IBarcodePickerCallback
object, but the application may not be in the same state as before.
Modifier and Type | Field and Description |
---|---|
static int |
BARCODE_TYPE_2D_ALL
Constant denoting the set of all two-dimensional barcodes that the handset is known to support (e.g.
|
static int |
BARCODE_TYPE_ANY
Constant denoting any type of barcode that the handset supports.
|
static int |
BARCODE_TYPE_AZTEC
Constant denoting Aztec barcodes only.
|
static int |
BARCODE_TYPE_CODE_128
Constant denoting Code-128 barcodes only.
|
static int |
BARCODE_TYPE_CODE_39
Constant denoting Code-39 barcodes only.
|
static int |
BARCODE_TYPE_CODE_93
Constant denoting Code-93 barcodes only.
|
static int |
BARCODE_TYPE_DATA_MATRIX
Constant denoting Data-Matrix barcodes only.
|
static int |
BARCODE_TYPE_EAN_13
Constant denoting EAN-13 barcodes only.
|
static int |
BARCODE_TYPE_EAN_8
Constant denoting EAN-8 barcodes only.
|
static int |
BARCODE_TYPE_ITF
Constant denoting ITF (Interleaved Two of Five) barcodes only.
|
static int |
BARCODE_TYPE_LINEAR_ALL
Constant denoting the set of all linear (i.e.
|
static int |
BARCODE_TYPE_PDF417
Constant denoting PDF-417 barcodes only.
|
static int |
BARCODE_TYPE_QR_CODE
Constant denoting QR-Codes only.
|
static int |
BARCODE_TYPE_UPC_E
Constant denoting UPC-E barcodes only.
|
Constructor and Description |
---|
ImagePicker() |
Modifier and Type | Method and Description |
---|---|
static void |
pickFromCamera(IImagePickerCallback callback)
Starts an image-capture using the hardware camera on this device (if available).
|
static void |
pickFromGallery(IImagePickerCallback callback)
Select an already-existing image on the handset via the handset's "photo gallery" or similar.
|
static void |
scanBarcodeFromCamera(IBarcodePickerCallback callback)
Find barcodes in a picture taken using the camera.
|
static void |
scanBarcodeFromCamera(IBarcodePickerCallback callback,
int barcodeTypes)
Find barcodes of a specific type in a picture taken from the camera.
|
static void |
scanBarcodeFromGallery(IBarcodePickerCallback callback)
Find barcodes using a picture in the gallery.
|
static void |
scanBarcodeFromGallery(IBarcodePickerCallback callback,
int barcodeTypes)
Find barcodes of a specific type using a picture in the gallery.
|
static void |
scanBarcodeFromLiveVideo(IBarcodePickerCallback callback,
float imageUpdateRate,
boolean useAutoFocus,
boolean useLight)
Use the device's camera to scan for barcodes in real time.
|
static void |
scanBarcodeFromLiveVideo(IBarcodePickerCallback callback,
int barcodeTypes,
float imageUpdateRate,
boolean useAutoFocus,
boolean useLight)
Use the device's camera to scan for barcodes in real time.
|
public static final int BARCODE_TYPE_ANY
public static final int BARCODE_TYPE_LINEAR_ALL
public static final int BARCODE_TYPE_2D_ALL
public static final int BARCODE_TYPE_QR_CODE
public static final int BARCODE_TYPE_DATA_MATRIX
public static final int BARCODE_TYPE_PDF417
public static final int BARCODE_TYPE_AZTEC
public static final int BARCODE_TYPE_EAN_13
public static final int BARCODE_TYPE_EAN_8
public static final int BARCODE_TYPE_UPC_E
public static final int BARCODE_TYPE_CODE_39
public static final int BARCODE_TYPE_CODE_93
public static final int BARCODE_TYPE_CODE_128
public static final int BARCODE_TYPE_ITF
public static void pickFromCamera(IImagePickerCallback callback)
callback
- the IImagePickerCallback
to notify when the application returns. Must not be null
.public static void pickFromGallery(IImagePickerCallback callback)
callback
- the IImagePickerCallback
to notify when the application returns. Must not be null
.public static void scanBarcodeFromCamera(IBarcodePickerCallback callback)
callback
- The class to notify when the application returns. Must not be null
.public static void scanBarcodeFromCamera(IBarcodePickerCallback callback, int barcodeTypes)
callback
- The class to notify when the application returns. Must not be null
.barcodeTypes
- The types of barcodes that should be detected (may be bitwise-OR'd together, e.g. AZTEC|ITF). Valid constants are defined in this class.public static void scanBarcodeFromGallery(IBarcodePickerCallback callback)
callback
- The class to notify when the application returns. Must not be null
.public static void scanBarcodeFromGallery(IBarcodePickerCallback callback, int barcodeTypes)
callback
- The class to notify when the application returns. Must not be null
.barcodeTypes
- The types of barcodes that should be detected (may be bitwise-OR'd together, e.g. AZTEC|ITF). Valid constants are defined in this class.public static void scanBarcodeFromLiveVideo(IBarcodePickerCallback callback, float imageUpdateRate, boolean useAutoFocus, boolean useLight)
callback
- The class to notify when the application returns, and also to validate barcodes.imageUpdateRate
- the number of frames per second that the camera should attempt to refresh atuseAutoFocus
- set to true
to enable if the handset supports it.useLight
- set to true
to use the flash as a torch if the handset supports it.public static void scanBarcodeFromLiveVideo(IBarcodePickerCallback callback, int barcodeTypes, float imageUpdateRate, boolean useAutoFocus, boolean useLight)
callback
- The class to notify when the application returns, and also to validate barcodes.barcodeTypes
- The types of barcodes that should be detected (may be bitwise-OR'd together, e.g. AZTEC|ITF). Valid constants are defined in this class.imageUpdateRate
- the number of frames per second that the camera should attempt to refresh atuseAutoFocus
- set to true
to enable if the handset supports it.useLight
- set to true
to use the flash as a torch if the handset supports it.