4 Replies Latest reply on Aug 20, 2014 2:44 AM by Pietro Francesco Maggi

    Rho.Battery.showIcon make app crash on Android MC40 JB

    Pietro Francesco Maggi

      I've build a native application using the page below put in the /public folder and remapping the start_path in the rhoconfig.txt to it.

       

      The page works correctly on an ES400 with Windows Embedded Handheld 6.5 but crash as soon as I execute the fnShow() and an Android MC40 JB. I tested with native browser and motorola browser, same result. The app is closed with an error message.

       

      Is the Battery.showIcon API supported on Android Motorola devices?

       

      ~Pietro

       

       

      <html>
        <head>
        <script src="./api/rhoapi-modules.js" type="text/javascript"></script>
        <script>
          function fnShow() {
            Rho.Battery.batteryStatus({}, display);
            Rho.Battery.showIcon({ left: 0, top: 40, color: '#FF0000', layout: Rho.Battery.BATTERY_LAYOUT_RIGHT });
          }
         
          function fnHide() {
            Rho.Battery.stopBatteryStatus();
            Rho.Battery.hideIcon();
          }
      
          function display(batteryValues) {
            //alert("Battery Level is: " + batteryValues['batteryLifePercent']);
            Rho.Battery.showIcon({ left: 0, top: 40, color: '#FF0000', layout: Rho.Battery.BATTERY_LAYOUT_RIGHT });
          }
          
        </script>
        </head>
        <body onload="fnDisplayBattery();">
          <div>
            <a href="#" onclick="Javascript:fnShow();">Show Battery!</a>
            <a href="#" onclick="Javascript:fnHide();">Hide Battery!</a>
          </div> 
        </body>
      </html>