TiBar: ZBar integration module for Titanium Mobile
Hello Titanium community,
we are proud to present our effort towards the integration of the ZBar project into a custom Titanium Mobile module.
We have opened a google code project namely TiBar which describes the usage of the module from titanium developer point of view.
The TiBar module extends the Titanium Mobile SDK 1.4.0 with rudimentary capabilities of scanning barcodes and QR-Codes.
The usage is as simple as usual titanium API calls:
//reference the module
var TiBar = Titanium.TiBar;
//use the scan capability
TiBar.scan({
success:function(data){
if(data && data.barcode && data.symbology){
Ti.API.debug("Barcode: " + data.barcode + " Symbology: "+data.symbology);
}
}
});
Please feel free to comment and contribute.
Current contributors: martin and lukasz
35 Answers
-
Is there any way to make it work for Android?
-
Hi Titanium community!
We have updated our TiBar module. The module allows you now to configure the barcode scanner (for example you can set the symbology). We added also
error
andcancel
callbacks. For more information and TiBar Test App see project page: http://code.google.com/p/tibar/Best regards.
Lukasz and Martin
[UPDATE 12.10.2010] Source code: http://code.google.com/p/tibar/source/browse/#svn/trunk/tibar Developer tutorial and new version is coming soon.
-
I'm trying to get it work in Titanium, but it always fails when I relaunch it in Titanium. It doesn't fail in X-Code. I made all changes you explained on the Google code page, except changing the base SDK version (I just have iOs 5). Does the module work on iOs 5 ?
-
martin - this is absolutely awesome. thanks so much for sharing this. i really can't wait to use this in an upcoming project!
-
Hi Martin,
I have no use for this at the moment, but on behalf of the community thanks for the share
Richie
-
It is a very good news, thank you guys for the works!
Btw, is there any plans for developing an android version later on?
-
Really nice, thank you very much, I hope this great example and your upcoming tutorial will trigger more developers to make such modules. I will be watching the project site for some more documentation on how to use the TiBar module (if it provides more methods / options than already given in the example). Good luck!
-
Great stuff! Looking forward to watching the progress of this.
I have a lot of QRCode ideas ;)
-
hi. first of all, congratulations for this great module. it's very usefull!. could you please tell us if there is a way to edit the "i" button? I cant find any documentation telling us how to do it.
thank's!
-
Hi Martin,
thanks for the great module. I have it working perfectly in 1.4.0, but I wanted to use it in the continuous 1.4.1 builds and I go through the install but get an error trying to run it:
Traceback (most recent call last):
File "/Library/Application Support/Titanium/mobilesdk/osx/c-1.4.1/iphone/builder.py", line 10, in <module>
from compiler import Compiler
File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.1/iphone/compiler.py", line 12, in <module>
from tiapp import *
ImportError: No module named tiappI added the libraries to the 1.4.1 xcode project and then created a new project, but no go. Hopefully I'm missing something simple.
Thanks for your help.
-
Awesome, guys!
Thank you very much. -
Anybody had a chance to try this out on the new iPod Touch yet? I have a client who bought an iPod Touch to try it out but he is miles away and I would really like a developer's take on whether it works or not. I am going to have him deploy my app to his device to check it out but if it doesn't work I'm not sure I'm going to get "developer friendly" feedback.
-
Just to let you guys know, this also works on the new iPod Touches! Thanks for the hard work!
-
Do you have plans to make this available for Android phones?
-
Hi Martin
I am integrating this into an existing iPhone app. Its great.
In version 0.2 (I think), the barcode scanner displayed some tracking lines around the barcode when it came into focus, and the scan callback was activated automatically. I prefer this to having a scan button on the camera screen. Has this functionality been deprecated in version 0.3 or is there some config i need to set?
Ah - figured this out - need to change the view controller config option.
Thanks
Jon -
I am having some issues getting this installed. I have the lib installed into my xcode project. When I tell the TI project to install the module it fails
<modules>
<module version="0.3">tibar</module>
</modules>I have tried with 1.4.0 and 1.4.1.1, both seem to fail. I am also running the iOS 4.1 SDK.
It hangs when it's building the app.
-
Hi there,
I have the same problem here, failed with 1.4 and 1.4.1.1.
I cannot paste my log because it's over 100kb (pastie's limit).
Here is the Titanium error, I don't know if it could be useful for you :
Detected an attempt to call a symbol in system libraries that is not present on the iPhone: mmap$UNIX2003 called from function _Z20TCMalloc_SystemAllocmPmm in image Zbar. Detected an attempt to call a symbol in system libraries that is not present on the iPhone: pthread_cond_init$UNIX2003 called from function _ZN3WTI17TCMalloc_PageHeap4initEv in image Zbar. Detected an attempt to call a symbol in system libraries that is not present on the iPhone: pthread_cond_wait$UNIX2003 called from function _ZN3WTI17TCMalloc_PageHeap15scavengerThreadEv in image Zbar. Detected an attempt to call a symbol in system libraries that is not present on the iPhone: mprotect$UNIX2003 called from function _ZN2TI3JIT35privateCompileCTIMachineTrampolinesEPN3WTI6RefPtrINS_14ExecutablePoolEEEPNS_12TiGlobalDataEPNS_21MacroAssemblerCodePtrES9_S9_S9_ in image Zbar.
-
Hi Lukasz and Martin
Can you share on how you did the integration with Titanium please? I've been watching the Google code page which indicates you were going to post this but nothing has appeared yet!
many thanks!
-
Hi Martin,
How can I access the image if i configured it like "takesPicture":true in the config parameters??
Thanks -
I have a demo app out to some testers (running 0.1) and one of them has updated to the latest iOS 4.2 GM dev build and says that the app freezes when hitting the scan button. Is this a problem with 0.1 only or is it seen in 0.3 too? And if so how long until the workaround (seen here: tibar issues) is implemented? Seems like a quick fix but I may be wrong.
I'm holding off on updating my dev phone to 4.2 so I can continue to work on my app without the freezing so I'm unable to test this myself.
-
Thought I would throw in my 2 cents. I was able to get the latest build working on a 3G. The catch, only the QR-Code seems to work. However, it works pretty well. I was using the TiBar Test app with the zBarReaderController, Camera, and any camera mode worked.
-
And updates on Android (zxing) support? Very interested in knowing this.
-
I have an issue when I try to install the plugin (maybe because I'm on OS X Lion) but libiconv doesn't seem to work when I build the project…
-
Will this module work on Android too?
Thanks
-
Hi Martin
Your module is very really good, except an issue with scanning barcode type EAN-13, sometimes it works but sometimes it can detect incorrectly. For example the barcode 4030287747295 sometimes is recognized as 4030227147895 or 4030227147291.
Please help us ASAP !
Thanks so much -
Hi Martin Your module is very really good, except an issue with scanning barcode type EAN-13, sometimes it works but sometimes it can detect incorrectly. For example the barcode 4030287747295 sometimes is recognized as 4030227147895 or 4030227147291. Please help us ASAP ! Thanks so much
-
So, this only works on iPhone 3GS and higher, yes? I'm guessing this because it looks like it requires video which, sadly, my 3G doesn't have (and nothing is happening when I press the "scan" button (when on the phone).
-
This is awesome! Love to see you expand into other modules as well :)
-
This is wonderful! I was just talking with some friends about how cool it would be to use this functionality in a project and did a little search and this popped up. Thanks for this, I've built the test app and am already starting to integrate it into my app!
I was wondering though, any other callback functions besides success? I want to give the user feedback when the code is scanned like vibrating the phone or triggering a sound? Maybe in a future version? I'll play around with it, maybe it will be responsive enough in the success callback.
Thanks again, I love it! Keep up the good work!
-
thank you guys! It's run just great for this first version.
-
This is just the kind of thing I need. Keep up the good work here. Thanks!
-
Hi there,
Is there a way to have a single application include this module and be able to run it on an iPhone 3G without the feature? I mean, checking in the code the OS version to enable the feature or not.
Right now, if I include this module, I get this error when booting the app in a 3G device (far before the JS code is run):
[Session started at 2010-08-24 15:42:25 -0700.] GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002 Loading program into debugger… warning: Unable to read symbols from "iAd" (not yet mapped into memory). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3/Symbols/System/Library/Frameworks/CoreMedia.framework/CoreMedia" (file not found). warning: Unable to read symbols from "CoreMedia" (not yet mapped into memory). warning: Unable to read symbols from "CoreVideo" (not yet mapped into memory). Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-74021-97 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… [Switching to thread 11779] [Switching to thread 11779] sharedlibrary apply-load-rules all continue dyld: Library not loaded: /System/Library/Frameworks/CoreMedia.framework/CoreMedia Referenced from: /var/mobile/Applications/1D7C10DC-BBB8-4284-83C7-D30EE1BE0BD2/Interplay.app/Interplay Reason: image not found Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.) mi_cmd_stack_list_frames: Not enough frames in stack. mi_cmd_stack_list_frames: Not enough frames in stack. (gdb)
I hope there is a way because it would be very hard to have two separate projects, one for iPhone 3G and other for iPhone 3GS and newer.
-
Doh! Double post, sorry!
-
Hi Martin,
We are using your module and it works great!! We have some questions about how to configure the 'i' button. is that possible?? in objective-C? thanxs!!
-
tibar is not work anymore. I hate Titanium! It is not good solution!. no QR code! no PayPal! I am anti Titanium now because QRCode!