Retrieving Product Information from Scanned Barcode in Android

I am developing a simple barcode scanning application that scans a barcode and displays product information.

Using Zbar Library I can scan a barcode and get the GTIN (Barcode Number) for any product.

How can I convert the scanned barcode data into actual product information that I can display to the user? Is there an API or library to do this?

+1


source to share


2 answers


Assuming you are referencing the common Point Of Sale barcode formats, they all have some variant of Product ID called a Global Trade Identification Number (GTIN):

  • UPC-A - GTIN-12
  • UPC-E - with zero suppression GTIN-12 [*]
  • EAN-13 - GTIN-13
  • EAN-8 - GTIN-8

Each of them, except GTIN-8, can be converted to GTIN-14 using the "0" prefix. (GTIN-8 is a discrete number system that does not currently map to any part of the GTIN-14 numbering system.)



Then the "Lookup" part of the following answer is applied:

fooobar.com/questions/2235363 / ...

[*] GTIN-12 with zero suppression can be converted to twelve-digit format ("UPC-A") as described here: fooobar.com/questions/2235381 / ...

0


source


You can use the latest Barcode Scanning Apis provided as part of Google Play Services 7.8 version. It has a Barcode class that provides displayValue, valueFormat, rawValue, url, phone, email, contactInfo, etc. All information related to the barcode that you can get and display to the end user. For more information, you can follow CodeLab , see Github example .



0


source







All Articles