2 Replies Latest reply on Sep 15, 2015 2:28 AM by Abhilash MB

    camera issues using javascriptAPI

    Abhilash MB

      Hi

      I am trying to implement the camera using javascriptAPI. I am currently using RhoMobile suit of version 5.2.2 and i have followed the steps as given in documentation. When i try to run the application i get a NullPointer Exception saying "Launching camera ha encountered a problem". I have attached both "index.html" and "build.yml", I am stuck at this point. Any help would be much appreciated.

        • Re: camera issues using javascriptAPI
          Joydeep Chakraborty

          Which device you are trying on?

          Please add rhoapi-modules.js in the page you are calling Rho.Camera.takepicture.

          <script type="text/javascript" charset="utf-8" src="/public/api/rhoapi-modules.js"></script>

            • Re: camera issues using javascriptAPI
              Abhilash MB

              Thanks,

              I was using the wrong library js file. I am able to open the camera and take a picture , but i am not able to display it in a img tag. i cannot find the imageUri anywhere. The code is as follows,

               

              function picture_taken_callback(params) {

                // Did we receive an image?

                if (params["status"]=="ok") {

                 // show it in our <img id="captured_image"> tag

                 $("#captured_image").attr("src", Rho.Application.expandDatabaseBlobFilePath(params["imageUri"]));

                }

               

              }

               

              <body>

              <img id="captured_image">

              </body>