Add a barcode scanner to an app in an afternoon, then spend the month on the lookup.
To add a barcode scanner to an app you mount a camera view, list the formats it should look for, and handle a callback that fires with the digits. In a React Native and Expo project that is the Expo Camera component with a barcode scanner setting, and it reads thirteen formats, including ean13, upc_a, code128 and qr. The limit is worth knowing first: a retail barcode hands you a number and nothing else. The camera work is close to adding a QR scanner. What happens after the beep is a different project.
This page covers which formats the camera module reads, why a scanned EAN or UPC is useless on its own, what makes a scanner feel broken in real use, and when a camera is the wrong sensor for the job.
Pick the formats you needThe short version
The scan is a settings line, the lookup is the product.
Two things have to be true before a scanning feature is worth building. The camera has to read the symbology printed on your items, which is a list you pass to a prop. And the number it returns has to resolve to something a person recognises, which is a table you own plus a rule for codes that are not in it yet.
A scanner that beeps and shows a row of digits is a demo. A scanner that shows the item, where it lives and how many are left is a product, and nearly all of that work sits behind the camera rather than in it.
Which barcode formats the camera actually reads
Retail barcodes and QR codes are not the same kind of thing, and it matters here. A QR code is a 2D matrix that holds text: a link, a WiFi credential, a contact card. An EAN or UPC barcode is a linear symbology, a row of bars encoding digits, which is why the number is printed underneath it. A scanner set up for one does not read the other unless you ask it to.
The Expo Camera component takes a list of barcode types: aztec, ean13, ean8, qr, pdf417, upc_e, datamatrix, code39, code93, itf14, codabar, code128 and upc_a. You pass the ones you care about and read the result in a callback that returns the type and the raw data. If your stock carries EAN-13 or UPC-A, both are in that list.
Two platform details will bite you otherwise. The module is documented as running on a physical device only, on both iOS and Android, so a scanner cannot be tested in a simulator. And pulling a code out of a stored image is narrower than live scanning: the docs say only QR codes are supported on iOS for that path, and that on Android the barcode should fill most of the image. Point the camera at the thing.
Expo Camera SDK reference, BarcodeType and barcodeScannerSettings
Try it
Which formats your scanner has to read
Tick only the symbologies your items actually carry. Restricting the detector to those formats is the documented way to speed it up.
ean13, upc_a
Every format here returns digits and nothing else, so the product name has to come from a table you own.
A retail barcode gives you a number, not a product
This is the fact that shapes the build. Google documents that structured data is parsed automatically out of the supported 2D formats, covering URLs, contact details, calendar events, phone numbers, ISBNs, WiFi credentials and geographic location. A linear retail barcode is not in that club. It carries an identifier, so a scan returns the digit string and the name of the format.
So the scan produces a key and you have to supply the table. If the stock is yours, the table is yours: scan each item once, type the name and the price, and every scan after that finds it. If the app has to recognise anything on a supermarket shelf, you need a product database with broad coverage, which is a licensing question rather than a coding one. We have not verified the terms of any specific provider, so confirm coverage and redistribution rights directly before promising that feature.
Decide which of the two you are building before you design a screen. An inventory barcode scanning app owns its catalogue and works the day you install it. A consumer price checker is mostly an outside lookup with a camera on the front, and it is only ever as good as the data behind it. Either way, write down what happens on a miss, because an unknown code is the normal case in the first month.
Google ML Kit barcode scanning, supported formats and limitations
What makes a scanner feel fast or feel broken
Speed is mostly about narrowing the problem. Restricting the detector to the formats you actually print is documented as a way to boost scanning speed, and a stockroom app that only ever meets Code 128 should not be weighing twelve other symbologies on every frame.
Then there are the documented gaps, none of which show up in testing and all of which show up in a stockroom. Google's scanner does not read 1D barcodes of a single character, ITF barcodes shorter than six characters, a format it calls flaky because it has no checksum, codes encoded with FNC2, FNC3 or FNC4, or QR codes generated in ECI mode. It also returns no more than ten barcodes per call.
The human factors cost more than the model does. A crumpled label, a curved bottle, frost on a freezer bag, a phone held at arm's length over a pallet. Plan for the scan failing rather than treating it as an exception. A field for typing the digits printed under the bars takes an hour to build and removes the worst support call you will ever take.
If your items are boxed, stacked or moving past on a trolley, the camera is the wrong sensor entirely. That is the case for an rfid scanner app instead: tags read without line of sight, several at a time, paid for with a tag on every item and a reader in every hand.
Build it, buy it, or skip it
Skip it when the catalogue is small and searchable. Two hundred products behind a search box beat a camera, and a scanner that saves two seconds an item does not repay a month of work. Count the scans in a day before you count the features.
Buy it when you need a full stock system. Off the shelf inventory software bundles scanning with purchase orders, suppliers, reorder points and valuation. If you want those things, you want the platform, not a scanner you wrote to avoid a monthly fee.
Build it when the scan is the small part of a workflow that is specific to you. A hire company checking kit back in against a job. A charity shop pricing donations as they land. A restaurant counting a walk-in freezer on a Sunday night. Generic software models a warehouse, and none of those is a warehouse.
Four ways to get the number into the app
| How you capture it | Works on a stock phone | Reads EAN and UPC | Extra hardware per user | Where the name comes from |
|---|---|---|---|---|
| Typed in by hand | Yes | Yes | No | your own list |
| Phone camera in your app | device only, not a simulator | Yes | No | your list or a licensed database |
| System scanner, then paste | Yes | Yes | No | wherever you paste it |
| Bluetooth laser scanner | once paired | Yes | Yes | your own list |
| RFID reader | No | tags, not barcodes | Yes | what was written to the tag |
Building the scan into your own workflow
Inventory platforms include scanning because they include everything, priced per user per month and built around purchase orders, suppliers and stock valuation. A workshop that wants to know which of forty tools went out in which van needs the scan, the location and the person, and none of the rest.
Newly is an AI app builder. You describe the app you want, including what a scan should do after it fires, and it writes a real React Native and Expo project you own, runs it on a cloud simulator while it builds, and ships it to TestFlight and to Google Play internal testing. It is $25 a month with no free plan, and iOS publishing needs your own Apple Developer account. Camera modules are device only, so the scanner is the one part you check on a real phone rather than in the preview.
Settle the offline question before you design any screens, because scanners get used in a warehouse with no signal more than anywhere else. Whether the catalogue lives on the phone or is fetched once per scan changes the data model and what the app can honestly show someone standing in a cold room.
Questions people ask about barcode scanning in an app
Request camera permission, render a camera view, pass it the barcode formats you expect, and handle the callback that fires with the scanned value. In React Native and Expo that is the Expo Camera component with a barcode scanner setting. The scanning code is small. The lookup that turns the number into something a person recognises is the actual build.
Describe what happens after the beep
Write down what a scan should find, where that list lives, and what the app does when the code is not in it yet, then build the scanner around those answers instead of around a camera.
Start building