Monday 6 February 2012

SL4A Scripting Languages for Android

In my hunt for programming capabilities on the Android, and some playing around with BeanShell I found something that worked very well.

I downloaded SL4A which is a scripting host for Android. It takes a bit of setting up, as you then need to install the BeanShell interpreter. However, from there I was able to automate a question I was wondering about.

The idea is simple, using a specific search term, can I get a feel for how much battery life people get from their handsets?

So after a bit of hacking at the script, I was able to simply searche for the handset name, and "battery lasts x days" where x was iterated.

The result:

HTC Wildfire battery days (1): 58
HTC Wildfire battery days (2): 199
HTC Wildfire battery days (3): 83
HTC Wildfire battery days (4): 8
HTC Desire battery days (1): 71
HTC Desire battery days (2): 943
HTC Desire battery days (3): 422
HTC Desire battery days (4): 7
Nexus One battery days (1): 4
Nexus One battery days (2): 240
Nexus One battery days (3): 444
Nexus One battery days (4): 0
Nexus S battery days (1): 37
Nexus S battery days (2): 237
Nexus S battery days (3): 72
Nexus S battery days (4): 3

My HTC Wildfire gets about 2 days, so that query technique feels like it has turned up some useful data.

And for those interested in the BeanShell script.

No comments:

Post a Comment