Chapter 10. Barcodes and scanners

 

Barcodes have been around since the 1970s, and there aren’t many products now that don’t use them. No doubt you’ve used barcodes in the supermarket at the self-checkout registers.

Barcodes are groups of black and white lines that represent numbers according to the widths and spacing of parallel lines. They can be read by either special optical scanners or smartphone cameras that provide product information that can be read by a computer. The barcode is considered to be one-dimensional (the lines travel in one direction). A QR code is a two-dimensional barcode (a matrix code). To read such codes, make sure you have a free QR code scanner such as QR Droid.

The barcode scanner in App Inventor is an easy-to-use, non-visible component that uses the phone’s camera to read a QR code or a barcode. The decision you have to make is what to do with the barcode once you’ve read it. In this chapter, you’ll make three apps: one showing how the numbers in a barcode can be used for a petfinder game, the next a practical app for getting information about a product by scanning its barcode, and the third a QR code treasure-hunt app that can be used to communicate clues to treasure hunters.

Barcode Petfinder app

Book Finder app

QR Treasure Hunt app

What did you learn?

Test your knowledge

sitemap