2 Replies Latest reply on Jan 3, 2013 9:12 AM by Derek Warren

    rho-javascript in build.yml?

    Stephen Skidmore

      I've been waiting for rhoElements 2.2 so I can use the camera api with javascript.  As I read the docs the following line throws me for a loop:

       

      You must enable JavaScript by putting rho-javascript into extensions in your build.yml.

       

      I'm building a web app that has no local code on the device just the rhoElements runtime.  The 2.1 JS apis, the imager for instance, did not require that java script be enabled this way.  Is the above required for web apps to use the new apis or just when using js from rhostudio?  If yes, it seems like the newly enabled apis are not available to pure web apps.

       

      Steve

        • Re: rho-javascript in build.yml?
          Glenn Sayer

          It looks like you need add it to your 'extensions' section to the bottom of you Build.yml (sample below).

           

          app_type: "rhoelements"

          capabilities:

            - shared_runtime

          sdkversion: "3.3.2"

          name: "RhoElements"

          version: "2.2.0112"

          vendor: "MotorolaSolutions"

          build: "release"

          bbver: 4.6

          applog: "rholog.txt"

          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

            version: "4.0.3"

            extensions:

              - 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"]

          • Re: rho-javascript in build.yml?
            Derek Warren

            Steve I believe you are correct that the Camera API through javascript is only available for a native application.

             

            Since you are using RhoElements as a runtime you can use the Imager API through javascript. This API has been expanded to include resizing of images. I just test this on my ET1 and was able to reduce the file size of the image from 192kB (3264x2448) down to 63kB (1280x960).

             

            See the desiredWidth and desiredHeight in the Parameters section.

            http://docs.rhomobile.com/rhoelements/imager/