[OPEN-ILS-GENERAL] Android application (was: GSOC-2011 Project Ideas Discussion)
Dan Scott
dan at coffeecode.net
Fri Mar 25 05:15:08 EDT 2011
On Thu, Mar 24, 2011 at 07:59:36AM -0400, Steve Wills wrote:
> Is anyone using a Droid barcode scanner in libraries? One would
> think that such a device would be a pretty handy thing to have. The
> JSON chatter part is straightforward enough from what I understand.
I've tried out the standard barcode scanner application on my Nexus One
and the results are hit or miss; a certain run of our Code 39 barcodes
from the 80's that seems to have lighter ink simply won't scan, for
example (to be fair, some cheap USB scanners that we tried out last year
won't scan this set of barcodes either), and it requires a steady hand
to use the phone's camera to scan the barcode. This is why, in the
Google Summer of Code project, I had pretty much assumed that serious
barcode scanning for something like an inventory project would require
equipment like a Metrologic scanner.
As far as the "JSON chatter part" (OpenSRF over HTTP) goes,
"straightforward" is relative. For example, finding the bibliographic
record from a barcode requires the equivalent of the following curl
request:
curl -H "X-OpenSRF-service: open-ils.search" --data 'osrf-msg=\
[ \
{ \
"__c" : "osrfMessage", \
"__p" : { \
"threadTrace" : 0, \
"payload" : { \
"__c" : "osrfMethod", \
"__p" : { \
"params" : [ \
"30007004981493" \
], \
"method" : "open-ils.search.biblio.find_by_barcode" \
} \
}, \
"locale" : "en-US", \
"type" : "REQUEST" \
} \
} \
] \
http://localhost/osrf-http-translator
Which gives a response like:
[
{
"__c" : "osrfMessage",
"__p" : {
"threadTrace" : 0,
"payload" : {
"__c" : "osrfResult",
"__p" : {
"status" : "OK",
"content" : {
"count" : 1,
"ids" : [
"149473"
]
},
"statusCode" : 200
}
},
"locale" : "en-US",
"type" : "RESULT"
}
},
{
"__c" : "osrfMessage",
"__p" : {
"threadTrace" : 0,
"payload" : {
"__c" : "osrfConnectStatus",
"__p" : {
"status" : "Request Complete",
"statusCode" : 205
}
},
"locale" : "en-US",
"type" : "STATUS"
}
}
]
... from which you would pick the bibliographic record ID from the "ids"
array, and then make subsequent requests to get the actual record
details, call number, etc, which you could then use to save to a
favourites list on your phone or whatever. Once you get into more
complex requests, you would want to be using fieldmapper support to
translate results into objects that you can manipulate. So,
"straightforward" in some respects, but not to be mistaken with "easy"
or "simple". My apologies for these deeply technical bits appearing on
-general, but Stephen provoked me :)
All of this that raises the more general question: what would the use
cases be for using the camera on your phone to scan the barcode of an
item you have in hand? Perhaps as a way of adding reference-only items
to your "items used" history list so you can find it more readily next
time, or jump from the citation to an online resource or alternate
location at some point in the future?
More information about the Open-ils-general
mailing list