0

//Hi i have developed one application in sencha touch 2 framework with the help of phonegap build.The thing is that i need to test my application so that i come to know battery usage of of my application. Can u provide some detail how to do that and whats the minimum battery consumption of a normal application .My application size is 2mb after phonegap build. Because i dont want my application drain mobile battery.

//Hey and one more thing is there any way to check battery level of mobile so that i can alert user battery is low and close application or put for mobile charge. The device itself show battery low than also i need to check.Provide me proper guidance in this.

1 Answer 1

1

To warn a user of a low battery:

window.addEventListener("batterylow", onBatteryLow, false); function onBatteryLow(info) { alert("Battery low! Current level " + info.level + "%"); } 

In terms of using "minimal battery consumption" it really depends on how efficient your coding is, how efficiently you manage resources, etc.

A good thing to remember though is always use a custom build of Sencha Touch to ensure only the the classes your project uses are being loaded. See:

http://docs.sencha.com/touch/2-0/#!/guide/building

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.