User:Anthony Salvagno/Notebook/Research/2010/03/23/Barcode Scanner Project

From OpenWetWare
< User:Anthony Salvagno‎ | Notebook‎ | Research‎ | 2010‎ | 03‎ | 23
Jump to navigationJump to search

Message Board Question

I sent a question to the folks over at zXing (makers of Barcode Scanner):

I'm interested in an application for Barcode Scanner. The application would be to acquire information about scans of a particular barcode (like how many times a barcode has been scanned and when) and then upload that to a google doc (maybe spreadsheet). My particular application is for the lab setting. I would like to use this to keep track of lab supplies and reagents and such. Basically I would make a QR code of a product/reagent and embed the name and url (of my online notebook) in the code. Whenever I use the item I would scan it and use the url to go to the page enclosed. I could then have the history of scans on that notebook page to determine how long I've had the item, when I've used it, and other various important pieces of information. My question is, how difficult would this be to implement? Does Barcode Scanner currently retain any information about barcodes its scanned? I have some information about what I want here: http://openwetware.org/wiki/User:Anthony_Salvagno/Notebook/Research/2010/03/19/QR_Codes_and_Barcode_Scanning with some of my own fiddlings. This is just one application of what I could see this being useful for and I'm sure I could think of more. Any help would be greatly appreciated. Thanks.

Replies

From Sean Owen (developer of zxing and Barcode Scanner)

It would not be hard to make a custom application that does this -- hardest part is figuring out how to post information to a spreadsheet, since I don't know about APIs for that. Calling out for scanning is easy though: http://code.google.com/p/zxing/wiki/ScanningViaIntent But if you're already making a web site to receive these clicks, you can track on the server side? no need for a custom app. On the other hand, the app already has a History feature. You can have it send the history via SMS or email. That's most of what you need, and doesn't require you to click through a URL each time you can. In fact you don't need URLs in the codes at all, just IDs of some kind, if you're going to mail them off. You might see if that does 90% of what you need before writing a new app.

My Reply

Well the barcodes won't be for products or anything like that (although I suppose they could be). The URL would be a reference. IE I could just label a tube (I work with little eppendorf tubes and getting information on the tube is troublesome) with the barcode that has a url and a name. When I scan the barcode I go to the url and that has all the information about the item I am currently using. I work on a wiki so information can easily change.

I like the idea of sending the history via SMS. I looked at the history feature but couldn't find timestamp information. I guess what I really need (not even a spreadsheet) would be some way to point to the history information. I saw that one implementation you guys are working on is compiling the history info with some info about the scan. I think it was in issue 8 or something. Is this correct? If I had a link to the history of a barcode scan I could easily iframe that link in my notebook or just straight up link it. I think this would be easiest. I'm not looking to make a new app if at all possible. Just work around the awesome one you guys already have.

Sean Owen's reply

Sure, the contents can be any ID -- it doesn't have to be a URL, but could be. If you're going to receive and process the history later then it can be whatever you like, and numeric IDs are simpler to encode. I can add timestamp and format to the history data that's sent. It might get split over several SMSes if you do it that way, but email works fine. You could have a process on the other end watching for email and doing whatever you like with the data in those emails. Or just log in to the receiving email account and see all the messages. In any event all that is outside the app, up to you how to approach it. None of this requires a custom application on the phone.

My Reply

What about when you scan a barcode? When I scan a barcode and go to history it gives me a history of everything I've scanned. Would it be possible to have a history of just one scan? For instance if I go to history and click a particular past scan that brings up the scan info and then if I went to history again it could show me the entire history (or whatever the device saves) of that single scan. Or if I scan something when the scan info comes up I click history and see the history of scans for that particular scan. If it is a new scan, then there will only be one time entry.

SO's Reply

I see, you want to see all times a scan decoded certain text. That's fairly application-specific, so we wouldn't add that directly to the app. However it makes some sense to add time and format info to the export format. You can mail it, and process it later. Or sure you can write a custom app that does anything you like.

My Reply

I agree that it is application-specific because I can't think of any applications other than my own. I'm wondering how difficult it would be to add that to the history (see all the history and then see the history of one particular scan). I think a great start would be just being able to get the time of a scan and exporting that. So I could say scan a qr code and then email or text that one scan with the time stamp and then process it later. Do you think that is a doable feature?

I love the scan history feature and emailing, but I'm not too big on the fact that I have to email my entire history. I could see cases where someone would want to text only a few scans and not everything or even just one (like in my application).

Findings

Someone asked this question:

Is there anyway to save scans to a db or something? --Duwayne M.

The reply is:

Yes the new version saves scanned contents internally. Look at the History feature.

I checked out the history feature. It doesn't show times and dates, just what I have scanned. QR codes work well because it will tell me what the qr code means. Product codes just displays the numbers and then i can choose to search google. It also shows me a list of every item scanned. I have the option to email/text the history but upon doing so I get the entire history. If only I had access to time stamps. They have to be in there somewhere. Check out this thread: http://code.google.com/p/zxing/issues/detail?id=8. It seems they are working on the features I want.

Barcode History Email

I tried out the history emailing feature and this is what I got:

2325012827901 653569293491 MECARD:N:Salvagno,Anthony;TEL:+19144894290;EMAIL:asalvagn@unm.edu;URL:http://www.openwetware.org/wiki/User:Anthony_Salvagno;URL:http://gradness.blogspot.com;NICKNAME:Ant MECARD:N:Salvagno,Anthony;TEL:+19144894290;EMAIL:asalvagn@unm.edu;URL:http://www.openwetware.org/wiki/User:Anthony_Salvagno;NICKNAME:Ant Anthony's Open Notebook is the best in the world. lick donkey balls 079400013439 market://search?q=pname:com.google.zxing.client.android

So sending that email every time would be annoying. If OWW ever gets a email to wiki feature, then that would be a step in the right direction. We would still need to have history of one scan and some way to update that history upon each scan.