I use ZXing to scan a regular barcode (not QR code) and I get a scanresult string, or to be more precise a number.
When I scan QR codes, it's easy to use the result because it always contains a URL to the Android Market. But how to use the number from a regular barcode? Which "search engine" to use to get the right product?
PS. quering this result number via google.com or Google Shopping returned no product at all
I've never used ZXing, but I see that it supports many barcode types. The type of the barcode will determine where you can look for it (i.e. it depends what you mean by a 'regular' barcode). If it's a UPC barcode, you can use something like this site.
If it's an ordinary 1D barcode, it might turn up in the UPC database. Other than that, there's not a strictly universal barcode database. Amazon's ecommerce API might help (it supports UPC lookup, but I don't know if it supports non-current products), and if you're in the UK then Tesco's has one as well that's worth a look.
Related
I was reading this article about NFC and Kotlin and tried to implement the Code in my App. I want to send a string from one device (from the customer) to the receiving device (supplier) for a faster checking - in (for example if you have booked a table, the device reads the booking-id from the customer-app and displays the regarding information on the supplier-device.
The problem is that:
this.nfcAdapter?.setOnNdefPushCompleteCallback(outcomingNfcCallback, this)
this.nfcAdapter?.setNdefPushMessageCallback(outcomingNfcCallback, this)
both Callbacks from the NFC Adapter are deprecated since API 29.
So is there any other way left to do this?
Google's documentation mentions the following concerning the deprecation:
File sharing can work using other technology like Bluetooth.
Indicating the feature was originally intended for file sharing,
not the sending of short strings.
Two solutions come to mind:
On the customer's device you generate a QR code containing the string you want to send over. With the supplier's device you scan the QR code. This way is often used for mobile payment and customer reward/discount apps.
A web service where the customer sends over their ID and then information is returned from a database.
You can also combine these approaches by for example letting the customer scan a static printed QR code containing the supplier ID. With the supplier ID your app could then submit the customer's booking ID and the supplier ID to your web service after which booking info is returned.
I want to create an android app by android studio to get information from barcode such as price and name.
the thing is i am new to this so i am asking if i can make a barcode reader that scans ean-13 barcode and get price and name from database like "Open Food Facts", the exact question is how can i make the barcode reader get the price and name ? do i have to link it with some kind of data base ?
btw i am using android studio with kotlin if it helps .
And this is my first topic, i don't know how things works here so if i did anything wrong please be free to point it
You will have to link the bar code scanner with a database if you want to retrieve the information from a given barcode.
For instance, if you are scanning the QR code embedded in a book that has a unique ID, you will then need to have access to the database of all the books mapped with their relevant QR code ID.
Could you share your exact use case here as that might help us understand what you're trying to do here.
Is it possible to store the UPC to your Android device, (excel or notepad) after scanning, and be able to send it to PC via WiFi? And make the data directly go into notepad or excel?
I'm developing an inventory system using the Android WiFi scanner. Please help me because I'm having a hard time searching if this is feasible.
I am actually working on this exact project for my work!
I downloaded an app called ScanPet! (you will also need to download Barcode Scanner - also free, and you dont need to do anything with the app) It will scan a barcode and automatically store the serial number. You can then input a couple other fields manually like model, price, comments, and a few others. The app stores it all in an excel doc that you can then email to yourself.
If you are using outlook, then its rather easy to scan the inbox, grab the attachment, open it, and then input the data from the excel doc into your database!! As you said, a batch call can be setup to scheduel the task as well!! Best of luck automating friend!
I am able to scan and obtain a QR code using ZXING. Based on the QR code obtained, I would like to navigate to a website if it is a URL or add to the contacts if its a contact detail. Are there any functions available in ZXING to do validations on the scanned QR Code?
Most definitely. Within core/ look at ResultParser (see http://code.google.com/p/zxing/source/browse/trunk#trunk%2Fcore%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fclient%2Fresult) This is where a raw result string is parsed into something structured. The Barcode Scanner source code in android/ has even more code that then ties in these results to platform actions.
Yes. https://market.android.com/details?id=com.google.zxing.client.androidtest&hl=de
Somewhat beta, but should help you.
Oh sorry, now I got it. Basically a QR-Code is just a String with some fancy stuff arround. If your App scans a QR-Code via xzing, you should only get the information without the fancy stuff. But if its an URL or a Contact or something else you have to decide yourself programatically, because you can store every kind of information inside a QR-Code.
I am not sure if this can be done. I am trying to pull a business info (mainly business name) from QR code. I am using zxing and I am able to scan it and get the URL. Now is there any other hidden info such as business name, address ..etc that I can pull from the QR code. If not, then can I use the URL maybe to get some of these info? Pleeease any insight is appreciate to how it can be achieved
PS: Ultimitally, I want the business to be shown on google map. Thats all
If the company name is recorded in a standard format in the QR code, like vCard encoding using the "ORG" attribute, then yes you can parse the raw text you get back by Intent from Barcode Scanner zxing using its ResultParser class. It will detect and parse vCard and you will get an AddressBookParsedResult object with an "org" property with this info.
Otherwise you're talking about guessing from free-form text what the company name is. There's no way to do that with zxing and that's a generally hard problem.