Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have no previous experience on creating a project for a seller which will use barcode reader. I am trying to put together a small project but I cannot figure out how the pieces should glue together.

I will create a sample with Motorola Scanner SDK to read barcodes and from that point, I have couple of questions:

  • How UPC barcodes work in general? AFAIK, a barcode stores the manufacturer and product info but no price data.
  • Should I store price information inside a database which corresponds to barcode data?

I would really appreciate if you can guide me here.

share|improve this question
In general a barcode is just an identifier of a product. So you can store it in your database as part of the product. And couple your price information to the product. –  Pieter B Oct 25 '13 at 8:10

3 Answers 3

Basically you're correct, UPC stores mf and item identifiers and allows you to identify given product (different packages will have distinct codes). You'd normally store all other information about a product in a database (name, price etc.) There is an exception which allows price storage in code when it's 'by weight' packed directly in store/by customer, but you probably do not deal with that case.

This link shows basic structure of UPC

share|improve this answer
thanks a lot. So, normally product does not hold price info inside barcode but they are certainly capable of doing that. –  tugberk Feb 14 '12 at 9:13
-1 This is wrong, the UPC does not store any data (information) just an ID. (You cannot in anyway tell the MF of or the item from a UPC, unless you look it up) –  Morons Feb 14 '12 at 13:55
@Morons You are wrong and misguiding OP. On both on your comments and also your response. UPC structure is strictly regulated. Would you care to follow link I posted? Or maybe this one? http://en.wikipedia.org/wiki/Universal_Product_Code. And yes, it can store price in a situation I described. –  wmz Feb 14 '12 at 15:17
@Morons You are right that UPC does not directly store mf or item name. My wording was not the best one. I will reword it –  wmz Feb 14 '12 at 15:35
@tugberk The only situation when you would store a price in UPC barcode is when, for example, you buy 2kg of apples. You weight it and print a code for it. In such situation barcode can carry either price or weight. This way you can automate payment for such items as well. As I said in my response, this is very specific –  wmz Feb 14 '12 at 15:46

Essentially the BarCode reader is an input device, not much different then your keyboard.

A UPC is one type of bar code. A bar code is series of lines where the width of each line determine the number. Some lines act as the standard line width unit, so the bar code can be any size, it the relative size that matters).

The BarCode is simply a device friendly way of representing numbers, you could replace a bar code scanner with an OCR device and print the numbers on the box, but bar code has a major befit over OCR where you don't have to worry about the orientation of the bar code.

All the scanner is doing is reading a Number and "Typing" into the computer system (You could just as well type the number in the same input box). Everything else is handled by the App.

The Barcode does NOT Store any data except for a single ID that your system has to handle. If your system has the wrong data mapped to the bar-coded ID, the wrong data is retrieved.

share|improve this answer
In other words, the barcode is an ID to a product record in a database where the price is stored, not the price itself. –  Robert Harvey Feb 15 '12 at 19:53

It is able to integrate such a upc barcode reader into the project to scan and decode the UPC barcodes. UPC barcodes only encode 12 or 6 numeric digits, so information of products couldn't be stored in this barcode symbol.

share|improve this answer

protected by Yannis Rizos Oct 25 '13 at 9:23

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.