Development

PhoneGap barcode reader plugin using ZXing

Merely a few weeks after I created my ZBar barcode reader plugin for PhoneGap, the user ascorbic added a ZXing-based barcode scanner plugin to the PhoneGap source tree. Talk about timing! If PhoneGap could have pulled that plugin just a month earlier it could have saved me many hours of scouring through PhoneGap and ZBar docs trying to figure out how to make my plugin.

Personally I like his syntax and naming a lot better than the names I chose. I named my stuff kind of dumb because I started it out as a test but when it came time to commit to git I didn’t want to rename the variables at the risk of breaking the code.

nginx caching for wordpress and drupal

Use Boost module for Drupal and then copy some nginx rules.

http://mechanix-tips.blogspot.com/2009/02/drupal-boost-rules-for-nginx.html

Wordpress Nginx proxy cache integrator plugin. Rather doing a proxy to Apache, I proxy nginx back to itself on a different port that is running fastCGI for the PHP.

http://wordpress.org/extend/plugins/nginx-proxy-cache-integrator/

Use ZBar barcode reader with PhoneGap

ZBar and zxing are two iphone-compatible barcode reader libraries. I figured out how to integrate Zbar with PhoneGap for use as a QR code reader in my PhoneGap iphone application.

The process has a few major steps.

  • Download and install PhoneGap.
  • Setup a PhoneGap application in XCode
  • Download and install Zbar.
  • Follow the Zbar documentation to incorporate the SDK library into your PhoneGap

Using the Git

  • Once you download the Git repository, copy the “ZbarPlug.h” and “ZbarPlug.m” files to the “Plugins” directory in your Xcode project.
  • Copy “ZbarPlug.js” to your Project’s “www” directory.
  • Link to the js file in your “index.html” file. Be sure to put it below the include for phonegap.js
cp ZbarPlug.h /path/to/xcode/project/Plugins
cp ZbarPlug.m /path/to/xcode/project/Plugins
cp ZbarPlug.js /path/to/xcode/project/www
<script type="text/javascript" 
              charset="utf-8" 
              src="ZbarPlug.js"></script>

The example pops a javascript alert when a bar code or QR code have been decoded. Now you need to adapt the library to your project.

ZBar Barcode reader / QR code reader code for PhoneGap.

Syndicate content