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)

        Scanner.enable      

        render :back => '/app'

      end

       

      http://docs.rhomobile.com/rhoelements/rhoelements-tutorial

       

      I was also taking Barcode Recognizer example given on gitHub :

      https://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/BarcodeRecognizer

      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

          Hi,

          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

          Pietro

          • 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

              #Scanner.start

              Rho::AsyncHttp.get(

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

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

                 )

            end

             

            def sacnner_callback

              #Scanner.stop

              #barcode hardcoding

                 barcode = "05042870"

              #end

            end

             

            Thanks

            Surendran S

            Kutir Mobility

            1 of 1 people found this helpful