3 Replies Latest reply on Jul 25, 2013 9:43 AM by Lars Burgess

    Barcode API

    Andraž Stošić

      Hi,

       

      I have problem enabling Barcode API in my project. I'm trying to capture barcode using ET1 camera and I always get error - Error: uninitialized constant InventoryController::Barcode...

       

      My build.yaml looks like this:

       

      app_type: rhoelements

      name: "RhoMobileScan"

      sdkversion: "3.5.0"

      version: "1.0"

      vendor: "rhomobile"

      build: "debug"

      capabilities:

        - camera

        - motorola_browser

      bbver: "4.6"

      applog: "rholog.txt"

      iphone:

        configuration: "Release"

        sdk: "iphonesimulator5.0"

        provisionprofile:

        codesignidentity:

        entitlements:

        BundleIdentifier: "com.rhomobile.rhomobilescan"

        BundleURLScheme: "rhomobilescan"

      wp:

        productid: "fc493c80-9464-0130-c3ca-00ff983cc087"

      symbian:

        uid: "0xe0359ad0"

      android:

        version: "2.1"

        android_title: 0

        extensions:

          - barcode

      extensions:

        - json

        - rholang

       

      my controller code is:

       

      #Use camera to capture product barcode

        def take_barcode

          Barcode.take_barcode(url_for :action => :take_callback)

        end

       

        def take_callback

          status = @params['status']

          barcode = @params['barcode']

       

       

          puts 'BarcodeRecognizer::take_callback !'

          puts 'status = '+status.to_s unless status == nil

          puts 'barcode = '+barcode.to_s unless barcode == nil

       

       

          if status == 'ok'

               show_barcode_info(barcode)

          end

          if status == 'cancel'

               Alert.show_popup  ('Barcode taking was canceled !') 

          end

          #redirect :action => :index

        end

       

        def show_barcode_info(recognized_code)

          Alert.show_popup  ('Barcode['+recognized_code.to_s+']') 

        end

       

      Any idea what is wrong?

       

      p.s. I'm building app on rhohub.