BarCode Scanning using Rhodes and RhoElement

Motorola barcode scanning devices are now supported with Rhodes3.3 and RhoElement2.0. Install RhoElements gem or RhoStudio and start developing for Motorola Windows Mobile, Windows CE and Android(ET1).

To enable this feature add following to build.yml:

capabilities:

-motorola

extensions: [“barcode-moto”] 

Barcode API :

How to get list of scanners present on the device? 

Barcode.enumerate 

this returns array of hashes (‘name’,‘id’).

How to enables the scanner?

barcode_callback get the same parameters as Barcode.take_barcode

Barcode.enable(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})

Callback parameters?

“status” – “ok” or “cancel”

“barcode” – recognized barcode string

How to disable a currently enabled scanner? 

Barcode.disable

This reverts the scanner to its default state and flushes any current decoder settings

Performing a soft trigger start? 

Barcode.start

If the scan does not result in a decode it is necessary to perform a soft stop before another soft start.

Performs a soft trigger stop ?

Barcode.stop 

Enabling the scanner and start scanner? 

Before callback is called scanner is disabled:

Barcode.take_barcode(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})

System API example: https://github.com/rhomobile/rhodes-system-api-samples/blob/master/app/BarcodeRecognizerMoto/controller.rb

source : Rhomobile.com

Share

Leave a Comment

Your email address will not be published. Required fields are marked *

Join My NewsletterSign up today and get notified on new curated updates from the world of programming, problem solving and health