1 Reply Latest reply on Jan 12, 2012 8:45 AM by Pietro Francesco Maggi

    Using Vibrator & Camera on ET1

    Ram Kumar

      Hello,

       

      My customer has query on using "Vibrator" notification and "Camera".

       

      The below is commented by the customer, and requesting assistance on the same.

       

      I tired few sample application for notification and imager, but I couldn’t get it right. Both notification.enumerate(); and imager.enumerate(); is not responding and the system hangs on executing these lines. Is there any configuration/reference file I’m missing ?

       

       

      Regards

      Ram

        • Re: Using Vibrator & Camera on ET1
          Pietro Francesco Maggi

          Hi Ram,

          Attached below you can find a small sample that enumerates Imagers and notification elements on the ET1.

           

          It works on my ET1 DV unit with BSP 112811 with RhoElements v1.0.1.1.

           

          Hope this helps.

          Regards

          Pietro

           

          -- Follows "enumerate.html"


          <html>

          <script type="text/javascript" src="../../Android/data/com.motorolasolutions.rhoelements/JSobjects.js"></script><!-- For Android Beta -->

          <head>

          <meta HTTP-Equiv="imager" Content="imagerEnumEvent:url('Javascript:fnEnumImagers(%s);')">

          <META HTTP-Equiv="notification" content="EnumNotificationsEvent:url('Javascript:fnEnumNtfy(%s)');">

          </head>

          <style>

          #cmdBar {

          position:absolute;

          top:600;

          right:20;

          }

           

          </style>

          <body BGCOLOR="#FFFFEA" TEXT="#0000A0" LINK="#FF0000" VLINK="#808080" ALINK="#008040" onLoad="fnSetEnumTimer();">

          <br>

          <br>

          <header onclick="history.back()">

              Back to Menu

          </header></body>

          <br>

          <div ID="msgImager"></div>

          <div ID="msgNtfy"></div>

          <br>

          <br>

          <br>

          <div id="cmdBar"/>

           

          </html>

           

          <SCRIPT LANGUAGE="JavaScript">

          var g_nImageCounter = 1;

           

             

          function fnEnumImagers(imagerArray)

          {

                var imagerInfo = "Imagers On Device: " + imagerArray.length + "<BR><select id='imagers_menu'>"

           

              for (i=0; i < imagerArray.length; i++) {

                  imagerInfo = imagerInfo + '<option value="' + imagerArray[i][1] + '">' + imagerArray[i][0] + '</option>';

              }

              imagerInfo = imagerInfo + '</select><BR>'

             

              msgImager.innerHTML = imagerInfo;   

          }

           

          function fnEnumNtfy(ntfyArray)

          {

              var ntfyInfo = "Notification On Device: " + ntfyArray.length + "<BR><select id='notification_menu'>"

           

              for (i=0; i < ntfyArray.length; i++) {

                  ntfyInfo = ntfyInfo + '<option value="' + ntfyArray[i][1] + '">' + ntfyArray[i][2] + '</option>';

              }

              ntfyInfo = ntfyInfo + '</select><BR>'

             

              msgNtfy.innerHTML = ntfyInfo;   

          }

           

          //  We can not call Scanner:Enumerate during page load on WM so give the page 3 seconds to finish loading

          function fnSetEnumTimer()

          {

              msgImager.innerHTML = "getting Imager data...";

              msgNtfy.innerHTML = "getting Notification data...";

              setTimeout("fnOnImagerEnable()", 3000);

              setTimeout("fnOnNtfyEnable()", 3000);

          }

           

          function fnOnImagerEnable()

          {

              var Generic = new ActiveXObject("PocketBrowser.Generic");

              Generic.InvokeMETAFunction('imager', 'Enumerate');

          }

           

          function fnOnNtfyEnable()

          {

              var Generic = new ActiveXObject("PocketBrowser.Generic");

              Generic.InvokeMETAFunction('notification', 'Enumerate');

          }

          </SCRIPT>