10 Replies Latest reply on Oct 29, 2013 7:50 AM by Remco van 't Land

    Rho.Barcode functions don't seem to do anything?

    Remco van 't Land

      Dear guru's,

       

      I've been trying to get the barcode scanning through the camera of an Android device to work, but haven't been able to do it so far. I'm not getting errors, basically nothing is happening.

       

      What I've done:

       

      I've created a new build with the following build.yml:

      ---

      app_type: rhoelements

      capabilities:

      - shared_runtime

      sdkversion: 3.3.2

      name: RhoElements

      version: 2.2.0113

      vendor: MotorolaSolutions

      build: release

      bbver: 4.6

      applog: rholog.txt

      javascript_application: true

      iphone:

        configuration: Release

        sdk: iphonesimulator5.0

        provisionprofile:

        codesignidentity:

        entitlements:

        BundleIdentifier: com.motorolasolutions.rhoelements

        BundleURLScheme: motorolasolutions

      wp:

        productid: 73a53de0-356f-012f-1f1e-0000600fe800

      symbian:

        uid: '0xe3ec9103'

      android:

        capabilities:

        - network_state

        - sdcard

        - calendar

        - camera

        version: 4.0.3

        extensions:

        - barcode

        - digest

        - digest-md5

        - digest-sha1

        - shared-runtime

        android_title: 0

      wm:

        extensions:

        - digest

        - digest-md5

        - digest-sha1

        sdk: MC3000c50b (ARMV4I)

      extensions:

      - json

      - rhoxml

      - rho-javascript

      sdk:

       

      I've installed this apk on the device (on a Huawei G510) and then adjusted the config.xml to show the following page:

       

      <html>
      <head>
      <script type="text/javascript" charset="utf-8" src="Javascript/rho_javascript_api.js"></script>
      <script type="text/javascript">
      function scan_using_default_scanner() {
          Rho.Barcode.take({}, scan_received);
      }

      function scan_received(params) {
          if (params["status"] == "ok") {
              alert('Barcode scanning complete. Scanned barcode: ' + params["barcode"]);
          } else {
              alert('Barcode scanning aborted');
          }
          Rho.Barcode.stop();
      }
      </script>
      </head>
      <body>
      <form id="form1" runat="server">
      <font size="6">
      <br /><br /><br />
      <a href="#" onclick="scan_using_default_scanner()" data-role="button" data-theme="a" style="max-width: 400px;">Get Barcode</a><br /><br />
      <a href="Test.aspx">REFRESH</a></font>
      </form>
      </body>
      </html>

       

      Clicking on the Get Barcode has no result whatsoever. I'm wondering if I activated the javascript correctly in the build and if so, how I can test if it's actually active. I've been looking all over the web and tried tons of examples and suggestions, but to no result.

       

      Hopefully some of you have experience with this sort of thing and can help me along; it's appreciated!

       

      Kind regards,

       

      Rem