Luckily, seems that:
1) The main barcode is PDF-417, for which there are some opensource en/decoders, even for android.
2) The vertical barcode code (in the 2/3 of the ticket) can be read e.g. by barcode reader on android.
> so you're gonna use @Suppress("DEPRECATION") a lot whenever you pull in an external library that relies on giving you activity result callbacks
Not true. They made ActivityResultContracts
customizable. So you can create a new class extending from ActivityResultContract
and do the parsing logic from onActivityResult
there and you can return any custom type from there. This way, all the messy parts about adding flags, data to the intent and parsing intent data from onActivityResult
are contained in the Contract
class itself.
Then we can use the nice API jetpack provides to launch the activity result contract.
Here is a custom Contract class I wrote to scan QR code using the ZXing library.
class ScanQRCodeContract : ActivityResultContract<Unit, String?>() {
/** * Copied the [Intent] creation from [IntentIntegrator.createScanIntent]. * */ override fun createIntent(context: Context, input: Unit?): Intent { return Intent(context, CaptureActivity::class.java).apply { action = Intents.Scan.ACTION putExtra(Intents.Scan.BEEP_ENABLED, false) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) } }
override fun parseResult(resultCode: Int, intent: Intent?): String? { return IntentIntegrator.parseActivityResult(resultCode, intent).contents } }
> Nobody is stealing your information. The app allows you to share contacts, apps, and bookmarks in a QR Code. This is why contacts permissions are needed. See "Visit Developer Website" below ( https://github.com/zxing/zxing/wiki/Frequently-Asked-Questions ).
Right from the link.
Are you randomly generating UUIDs? Or are those HD serial numbers? You could try to use something like UPC-13 which support up to 17 digits (using EAN 5 extension) and is readable by most barcode scanning engines. You could also try any one of the many 2-D barcode types e.g. PDF-417, which has been around forever and is public domain. The popular barcode scanning library for Android Zxing has beta support for it, not exactly sure what that means but you can probably get at least few hundred characters in there.
The other comments explain how to use zxing, but I also wanted to shed a bit of light into how it actually works internally. I'm on mobile so I'll try to balance this out to be detailed and brief at the same time.
The zxing library uses the onPreviewFrame() callback method from the camera, which gives you YUV RAW data from the camera preview. Depending on the hardware and camera parameters you set, this could be somewhere between 15-30 FPS that you will be getting on that callback, and you can't block that method. So what they do is that they get that data, dump the unnecessary bytes from the outside square and the colors (UV), only "reading" the contrast of the luma (Y) to find the black lines, and then getting the relative widths of all the lines found (barcode). There's obviously some other things happening and the implementation is more complicated than how I'm putting it here, but it works very fast and the code is very interesting to go through.
It's all open source and you can see and learn even more about it by going through the code: https://github.com/zxing/zxing
>Don't do this. Use a dedicated barcode reading library, like https://github.com/zxing/zxing
Thank you for your comment. Main goal of article is to show how you can use CameraX and Firebase ML Kit together with QR code scanner. However, of course if you like, instead of Firebase ML kit, you can use zxing.
Its nothing special of a QR code - just the string WIFI:S:<SSID>;T:<WPA|WEP|>;P:<password>;;
(docs) as a QR code.
Checkout Google's Zebra Crossing (ZXing) library - if it supports the barcode format he is using it may be of value. I have used it in the past - although I was using it to generate the barcodes initially so it was very much integrated into the overall system. (Android phone with an application and camera would scan the code and direct to the server with the appropriate URL and query params).
Edit: You'd have to checkout the APIs further to see how you could handle returning and parsing results from Google about the products, if they are even in their public database. It might be better, although more work, to have your friend have an admin app on his phone that can scan his inventory and let him enter the information about the product associated with that barcode and then save that to a database (probably relational data so SQL makes most sense but something like Mongo could certainly work as well). Then a different app could tie the scanner to the existing database and use a REST server to generate a webpage with the product data populated into a standardized template.
It isn't, I'd definitely head on over to /r/androiddev to find an answer.
Since I'm already here though, this library was touted to me as the de-facto way to make a qr reader: https://github.com/zxing/zxing/blob/master/README.md
A URL is the most common of several data types that a QR code can contain, so probably. You can also put in there just text, a phone number, E-mail address, geographic info, etc. It's not a very well defined standard from what I can tell, but you can find some of the most common data types here.
9/10 times, if the app encounters a URL, it will just open it.
I am a BS Software Dev student. I have no experience but I'll offer what advice I can.
>What is the best open source scanner for QR codes?
Not ever built one but searching through the BitStore Source I found uikit for iOS and then I found zxing is popular for Android. However, if I were to begin a project now I would try Zbar SDK
>Can one scanner read a 25x25 QR code as well as a 41x41?
Yes.
>What is the smallest a QR code could be printed and quickly scanned by a smart phone?
I had iPhone 4 and found it to be the toughest phone to read QRs with. I say about 1.5 x 1.5 inch to be the smallest.
>Is there a solid data matrix reader that is fast and accurate that is open source?
Zbar
This. You can also make a scannable QR code with the SSID and passphrase (using your generator of choice) that works with modern iOS and Android versions.
If you have a fancy thermal label printer in the office, you can put the SSID, passphrase, and QR code on it and paste it around tastefully.
> […] whats the fastest way to move that to the Mac and have it read
Fastest? Take a screenshot in your iPhone, save the image in iCloud Files, then download the screenshot in your computer. Done.
Alternatively, you can open any app in your computer with camera capabilities like FaceTime, Photo Booth, etc., put your iPhone’s screen in front of the computer’s camera, take a picture. Done.
Once you have the QR image in your computer, use the command zbarimg to decode it via the Terminal app. Done.
If you don’t want to install that command, or don’t know how to use the Terminal, then decode the QR image using this website: https://zxing.org/w/decode.jspx . The code is open-source if you want to inspect it: https://github.com/zxing/zxing
Encoding images in QR codes isn't reall possible due to size constraints. But technically you can do WiFi passwords already, you just need to encode them right: https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
>Why did you specifically mention those apps? I think I have barcode scanner but never really had any issues with my phone because of it.
These apps can cause the problem of Chrome opening a website.
There is a difference between "Barcode Scanner"s https://github.com/zxing/zxing/issues/1345
Sounds like a neat idea. You could buy a cheap domain from Google Domains and hook it up with their Analytics platform.
That way you control your domain instead of some third party QR code Specific service.
Here are some free standard QR data formats including URLs, contact information, auto-filling SMS messages and phone numbers.
I like "Barcode Scanner" from ZXing on Android, or zbarcam
on Linux...
A lot of phones include the functionality, including my Mums old Moto G4 with the built in Camera, and more recent versions with Google Lens. QR scanning is also supported by, as in "just works" with iOS for the last few years. -- I know these last few aren't opensource, but sometimes it's handy to communicate by QR code to other users too, e.g I have a one line shell function that prints various WiFi credentials as a QR code to the terminal.
Removed: Rule 4.
There are a handful of C# compatible QR code generating libraries. Here's a quick list: (I'm not endorsing any or have checked their ease of use.)
https://github.com/zxing/zxing
https://github.com/codebude/QRCoder
https://www.codeproject.com/Articles/1250071/QR-Code-Encoder-and-Decoder-NET-Framework-Standard
But that's the easy part.
The QR codes are just there to deliver something to the person who reads it. It could be a UPC code, or a URL, some GUID identifier, or information about the product, etc. Wiring the QR codes with whatever your backend banking apps or payment methods is likely going to be many orders of magnitude more complex and involved. And because it's much more dependent on how those payments are done and interface with your particular bank, there probably isn't any kind of "library" that's just going to do it for you.
There is no intent for doing this. So no you can't just open an app that can read the code. At least not on every device...
The best option would be to find a QR code library and add this into your project, the most popular one is this one:
This repo has barcodes and qr codes in various distortions to test detection.
edit: more specifically look in false positives and upce folders for distorted barcodes.
From the front-end (client) point of view, I can imagine that as a simple android Kotlin application (Jetpack, Retrofit, OkHttp, Gson) utilizing a library like zxing:
https://github.com/zxing/zxing
If your requirement is to CRUD, utilize and distribute that data you're operating not on the temporary unreliable client-side, but on the cloud, then you can develop simple backend with Firebase Database solutions or AWS API Gateway + AWS Lambda + AWS RDS or AWS Elastic Beanstalk + Spring (Kotlin) application + RDS stack.
in the description my dude:
> Nobody is stealing your information. The app allows you to share contacts, apps, and bookmarks in a QR Code. This is why contacts permissions are needed. See "Visit Developer Website" below ( https://github.com/zxing/zxing/wiki/Frequently-Asked-Questions ). >
I personally use Barcode Scanner and am happy with it, but I have not compared it to any other. That's why I was curious as to why one would prefer one over the other.
The only features I am missing is that the export of a contact to a QR code supports few fields. Particularly, the IM field from vCard 4.0 is not supported, even though instant-messaging is everywhere now. It seems to me that all these open-source apps are based on the ZXing library anyway, so they would share that shortcoming.
I've not used this, or indeed, any other barcode scanning lib on RN, however, I have used the underlying lib on other projects. Maybe have a look at:
https://www.npmjs.com/package/react-native-zxing (there are others, I just googled `zxing react native`)
It's the "zxing" that's the important part, the core lib if you will. My apologies if you've already tried and discounted this.
Oh yeah man, this tutorial plus this site basically let me do custom QR codes for just about anything. We're looking to do landing pages for her newsletter, a virtual clothes tag (my wife does custom sewing), for garment wash instructions, and anything customer contact related.
Now I just have to get better at silk screening and weeding vinyl lol.
I can’t think why it dosen’t work.
I built the regular expression to automatically input the escape text: https://www.icloud.com/shortcuts/341c115377244651a9d2ce9bc1cdf1ba
If your phone's resolution is sufficiently high then you could use Barcode Scanner generate barcode intent then do a screen capture and crop. This even works offline. Example:
Send Intent [
Action: com.google.zxing.client.android.ENCODE
Extra: ENCODE_DATA:KulbhushanChand
Extra: ENCODE_TYPE:TEXT_TYPE
Target: Activity ]
> "Says it was removed for violating some terms of the developer program. Comical as it hasn't been updated in a long time and has been around in the same form for a decade. I will try to get more info on what the issue is."
https://github.com/zxing/zxing/issues/1133#issuecomment-461910579
Use the Drive API in your app. It'd be a little work, but is very efficient.
You could get your kidapps to check a resource regularly, say to a site you host, however this may generate excessive traffic.
AutoBarcode can help here. It can be used to both read and write QRCodes.
As for the text to use,
WIFI:S:<SSID>;T:<WPA|WEP|>;P:<password>;;
So if our WiFi if Home Wifi and it's WPA(2) with a password of ABCDEF098
WIFI:S:Home Wifi;T:WPA;P:ABCDEF098;;
More information on what you can put in the text field.
I am glad someone posted this! I recently found out about the QR codes (see github, iOS 11+) and found that they do not work on my guest network.
I have three WiFi networks:
Now here is where it gets interesting..... Both the IoT and Guest networks have "Guest Policies" applied (for client isolation... I don't need an IoT device to pivot to other devices). I can join the IoT network using the QR code. I can not join the guest network with my iPhone. After scanning the QR code (using the camera app) it spins for awhile and then says Unable to join the network.
Has anyone else run across this? At first I thought it was because there was a !
in my password, but I removed that with the same results.
OH: No guest portal... just client isolation (but that is also on the IoT network.
Related question for /u/iProbablyUpvoted: My phone doesn't save the network.... it will connect to it (the IoT one anyway) but if I switch networks and try to switch back it will prompt for the password. Have you had the same results?
The Snapchat codes aren't really QR codes, they are proprietary. If you stick a standard there are tools out there to help you (like zxing).
Is there a reason you can't use QR? Is there another 2D format that suits your needs?
Reading:
https://github.com/zxing/zxing/blob/master/README.md
Generating:
http://barcode4j.sourceforge.net/
How are you using the codes? Sounds like you're using it to embed links with custom redirects. Do you need to manage these redirects too?
Java isn't the best tool for security research, because there is a lot more code out there using Python that you'll be able to re-use. I just picked Java because it was the first language I recognised when I searched for "QR code decoder" and found https://github.com/zxing/zxing.
Well I wouldn't mind using a barcode scanner app for android. For example, xzing's barcode reader app. It's open source. My experience with Java development is pretty limited, but I've dug through the code for it and I think I found the code that would need to be modified in order to read this barcode and others like it. The line I believe that would need to be modified is here. I could probably also make the reader the unscrambled version of the barcode such that when it scans abcxyz, it returns xyzabc. When I get some more time I think I'll try it. But like I said, my experience with Java development is pretty limited.
On Android, the ZXing library is I think generally recommended for reading barcodes. It looks like Google has a barcode API too. If you're using either of these, basically you'd write an app that has the credentials to talk to your MySQL database and uses the library. Every time the library reports a successful scan, the app should take the data and insert it into the database. Both Android and iOS let you write an app for just your device, without publishing it, so that way you can just hard-code the credentials and not worry too much.
Also, to suggest another option, if you buy a physical USB barcode scanner, those things generally behave as keyboards. When they detect a barcode, they'll "type" the digits they've scanned followed by the Enter key. So you can use one of those + a laptop + some very simple script/code that just prompts for input. I've done this before and it's straightforward.
No it doesn't, it uses ZXing to scan the codes. ZXing is very polished and light, but can only scan specific formats of data.
I looked at the Vision API page and it seems really interesting, but unfortunately I cannot help you with that. Best of luck with your project!
For that, look at the zxing encoder source code line 278
You probably have a unique identifier for each user. Like e-mail, username, user id etc... You can use one of these to generate and scan QR codes. I used this library to scan QR codes and I think i generates them as well.
Analyzing Teraload
trust score 89.5%
Fun facts about Teraload
The ZXing library seems to fit your needs. I believe the original is written in Java and there is a .NET port available.
These links might be of use but this is just from a quick google search.
Yeah, any kind of image recognition is probably going to be kinda hard. I just thought for starters a QR code may seem to be a little easier since it's just black and white squares. But then of course you've got to check that it's valid etc. But good luck with your endeavours! I just found this after a quick google and I'm not sure how much help it will be to you but take a look at ZXing (https://github.com/zxing/zxing)
But a better description would help.
Okay, but really, here's some links:
http://developer.android.com/training/index.html, https://github.com/zxing/zxing/
Although since you know nothing about programming or app development, you are probably looking for someone who does. And you are probably also in for a surprise on how much effort it takes to make what you may think is a "simple" app.
Good luck though!
Flash is a lot of fun to develop with and relatively easy to pick up, and while it is capable of compiling for iPhone, I probably wouldn't recommend it for that purpose. I'm not a mobile developer though, so I'll defer to someone else to make alternative suggestions.
The keyboard wedge scanners won't apply for an iPhone app though, as they're usually reliant on a USB connection, so if your target platform is iOS, you'll need to look into another avenue for your barcode scanner. Perhaps an optical solution like ZXing or maybe a Bluetooth scanner.