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.
Related
I was wondering if I could provide a link to be followed by a web browser (most specifically in a QRCODE) to insert a contact with the contact data already filled. I tried content://com.android.contacts in my mobile firefox but it crashed. I also couldn't find any absolute URI for this in the Android documentation. Is it possible?
If you want to do this with QR code, another phone should always have program which can parse QR code information and call system method to add contact.
But in Android you can programmatically share contact.
This link can be helpful: How to share a contact programatically in android
I am wondering one thing, when you scan a bar code with ZXing scanner, how to go and get the result of the barcode data from Google Product database ?
I already got a database to store the scanned result btw.
I have no clue recently though I have read some of the stackoverflow topics regarding with this topic.
Research that I have done so far:
I have been looking into this :https://developers.google.com/shopping-content/getting-started/usingapi-products
But I don't understand... because i m not sure if Android includes the JSon and Atom?
I know this question is so general but I need some explanations as well because I didn't understand it.Thank you ! :)
You can simply search barcodes by opening the browser with the following URL: http://www.google.com/m/products?q=YOUR_BARCODE
Or you can use Google Search API for Shopping if you like to handle the result on your own (show results/offers in your app). In that case you are restricted to 2500 requests per day (http://code.google.com/intl/de-DE/apis/shopping/search/v1/getting_started.html)
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.
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.