Scan

Action: 
com.google.zxing.client.android.SCAN
Intent Extra: 
Scan mode
Intent Extra: 
Scan result

Scan a barcode.

Send this intent to open the Barcodes app in scanning mode, find a barcode, and return the results.

By default, sending Scan.ACTION will decode all barcodes that we understand. However it may be useful to limit scanning to certain formats. Use Intent.putExtra("SCAN_MODE", value) with one of the values below (optional).

  • PRODUCT_MODE: Decode only UPC and EAN barcodes. This is the right choice for shopping apps which get prices, reviews, etc. for products.
  • ONE_D_MODE: Decode only 1D barcodes (currently UPC, EAN, Code 39, and Code 128).
  • QR_CODE_MODE: Decode only QR codes.

If a barcode is found, Barcodes returns RESULT_OK to onActivityResult() of the app which requested the scan via startSubActivity(). The barcodes contents can be retrieved with intent.getStringExtra("SCAN_RESULT"). If the user presses Back, the result code will be RESULT_CANCELED.

See Android Manifest, com.google.zxing.client.android.Intents, and com.google.zxing.client.android.Contents

Applications providing Scan

Titlesort icon Provides intent actions Provides intent URIs Uses action Uses URI Description
Barcode Scanner - ZXing library

Multi-format 1D/2D barcode reader.