Read Barcode


  • Barcode


  • Android smartphone - example does not run on the emulator
  • Download to your smartphone the ZXing ("Zebra Crossing") program. ZXing is an open-source, multi-format 1D/2D barcode image processing library.

Do try out the ZXing program first to familiarise with its operations before running the example program below.

This program reads the barcode.

import android droid = android.Android() (id, result, error) = droid.scanBarcode() print result['extras']['SCAN_RESULT'], error

Code Explained

The barcode text is returned in result['extras']['SCAN_RESULT']

Python for Android
| TOC | 1 | 2 | 3 | 4 | 5 |