3 Replies Latest reply on Apr 30, 2013 12:27 AM by Kutir Mobility

    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?

        • Re: Difference between Scanner and Barcode?
          Pietro Francesco Maggi


          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


          • Re: Difference between Scanner and Barcode?
            Kutir Mobility

            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

            1 of 1 people found this helpful