Difference between Scanner and Barcode?

I was following RhoElement tutorial of Inventory Management, confused with "Create A Scan Inventory Page" where it has used Scanner not Barcode scanner,

def scanPage

Scanner.decodeEvent = url_for(:action => :decodeEventCallback)


  render :back => '/app'



I was also taking Barcode Recognizer example given on gitHub :


where it has used Barcode.barcode_recognize to do the same task?

Please help me out what is the correct way to do the scan a barcode?

I am creating a sample app to use scanning and showing barcode data in view .Is there any way to test on Simulator?

Pietro Francesc...
Hi,Current stable version of


Current stable version of RhoElements includes two different APIs to handle barcode scanning:

  • Scanner API, used in Motorola devices. This API includes all the parameters required to fully utilize a real barcode scanned HW (in the device or connected through bluetooth)
  • Barcode API, for all the devices. This API uses the camera to acquire a barcode. It's intended for consumer devices with far less features than enterprise devices with dedicated HW.

In RhoElements v4.x, currently in beta, these two APIs are merged in only one, Barcode. The Scanner API will be deprecated but supported.

I Hope that this clarifies.

Best regards


Vote up!
Vote down!

Points: 0

You voted ‘up’

Ankur Srivastava
Thax for the information On

Thax for the information

On Apr 29, 2013 12:44 AM, "Pietro Francesco Maggi" <

Vote up!
Vote down!

Points: 0

You voted ‘up’

Kutir Mobility
Hi AnkurOne more difference

Hi Ankur

One more difference is(Rhoelement2.x)

If you use barcode, you should add barcode extension and camera capability in build.yml.

Scanner is not dependent on the barcode extension.

The Scanner Module provides access to control the functionality of all the device’s scanner.

Barcode and Scanner will not work in the simulator.

We do this kind of hack to test barcode functionality in Rhosimulator

def take_scan



     :url => "http://www.google.co.in",

     :callback => (url_for :action => :sacnner_callback )



def sacnner_callback


  #barcode hardcoding

     barcode = "05042870"




Surendran S

Kutir Mobility

Vote up!
Vote down!

Points: 1

You voted ‘up’

Log in to post comments