[ 
https://issues.apache.org/jira/browse/CB-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13204183#comment-13204183
 ] 

Steve Gill commented on CB-173:
-------------------------------

Sorry for not commenting sooner, I somehow overlooked this thread. 

I just checked this out, and as Joe said, the issue still exists in 1.4.1. I 
don't believe it is a packaging error though. The XML folder I copy into the 
release is generated by the create script. Looks like plugins.xml in the 
framework directory was incorrect, hence why the generated plugins.xml in the 
example app was incorrect. 

Just tried it on the latest code and it is fixed. Shouldn't see this pop up in 
the next release.


                
> Battery events not working properly on HTC Inspire running 2.2
> --------------------------------------------------------------
>
>                 Key: CB-173
>                 URL: https://issues.apache.org/jira/browse/CB-173
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.3.0
>         Environment: HTC Inspire, Android 2.2
>            Reporter: Filip Maj
>            Assignee: Steve Gill
>             Fix For: 1.5.0
>
>
> Originally reported by Ray Camden:
> Trying to get a very simple battery status app working. None of my events 
> ever fire. According to the docs, batterystatus should fire when 
> plugging/unplugging a device, but that doesn't trigger it either. Any ideas? 
> HTC Inspire, Android 2.2 SDK. Code below. Note the alert in my battery status 
> callback. I did that in case I screwed up something simple in drawStatus.
> <!DOCTYPE HTML>
> <html>
>   <head>
>     <meta name="viewport" content="width=320; user-scalable=no" />
>     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
>     <title>Minimal AppLaud App</title>
>         <script type="text/javascript" charset="utf-8" 
> src="phonegap-1.3.0.js"></script>
>         <script type="text/javascript" charset="utf-8">
>               var status;
>               var drawStatus = function(info){
>                       var s = "<p><b>Battery Status</b><br/>";
>                       s += "Level is "+info.level + "<br/>";
>                       s += "Plugged in is "+info.isPlugged;
>                       s += "</p>";
>                       status.innerHTML = s;
>               };
>                               
>               var battCrit = function(info) {
>                       navigator.notification.alert("Your battery is SUPER 
> low!");
>                       drawStatus(info);
>               };
>               var battLow = function(info) {
>                       navigator.notification.alert("Your battery is low!");
>                       drawStatus(info);
>               };
>               var battStat = function(info) {
>                       alert('test');
>                       drawStatus(info);
>               };
>         
>         var onDeviceReady = function() {
>                       //listen for battery crit
>                       window.addEventListener("batterycritical", battCrit, 
> false);
>                       window.addEventListener("batterylow", battLow, false);
>                       window.addEventListener("batterystatus", battStat, 
> false);
>                       alert("registered...");
>         };
>         function init() {
>             document.addEventListener("deviceready", onDeviceReady, true);
>                       status = document.getElementById("status");
>         }   
>         </script>  
>   </head>
>   <body onload="init();">
>     <h2>Battery Tester</h2>
>       <div id="status"></div>
>   </body>
> </html>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to