1% Battery Icons on Liberty (possible?)

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
I'm fairly new to theming but i was looking through my pulled framework-res and found "stat_sys_battery.xml" and "stat_sys_battery_charge.xml"

I opened them up and started trying to decipher the code:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<level-list
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="0" />
    <item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="10" />
    <item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="20" />
    <item android:drawable="@drawable/stat_sys_battery_30" android:maxLevel="30" />
    <item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="40" />
    <item android:drawable="@drawable/stat_sys_battery_50" android:maxLevel="50" />
    <item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="60" />
    <item android:drawable="@drawable/stat_sys_battery_70" android:maxLevel="70" />
    <item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="80" />
    <item android:drawable="@drawable/stat_sys_battery_90" android:maxLevel="90" />
    <item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
</level-list>

I was wondering if you include lines for all 100 values and add the image files, will it show all 100%? So i edited the xml files and created 150 png files (i probably should have tested the concept first). I loaded everything on to my phone and now no battery icon shows up.

My question is should I keep trying to figure out where I did something wrong, or is it a known issue that the battery resolution is based on a deeper (ROM/Kernel) level?

thoughts?
 

hond2

Member
Joined
Mar 13, 2011
Messages
58
Reaction score
0
It must be possible, because an app called battmonx can show 1% on my droid2!
Now if only I could find someone to write a zip update that would safely remove the original batt indicator from statusbar...

Sent from my DROID2 using DroidForums
 
OP
M

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
is battmonx an app/widget or does it actually replace the icons in the status bar?

from what I've heard (i am totally unsure about this) the 1% battery widgets interpolate and estimate between 10% values rather than actually read 1% increments from the phone. again, i am totally unsure about this.
 

sonicfreak360

Member
Joined
Aug 19, 2010
Messages
534
Reaction score
0
It must be possible, because an app called battmonx can show 1% on my droid2!
Now if only I could find someone to write a zip update that would safely remove the original batt indicator from statusbar...
Droid X and Droid 2 must have the hardware for it...
Sent from my DROID2 using DroidForums



Sent from my Droid using Tapatalk
 

pedwards3x

Developer
Developer
Joined
Dec 7, 2010
Messages
208
Reaction score
0
Location
Indiana
Your original concept should work just fine, but here's my question: What did you use to decompile the .xmls and how did you edit them and then recompile them?
 

thebird36

Member
Joined
Oct 31, 2010
Messages
410
Reaction score
1
Location
New York
Try battery moniter that has 1% increments for the notifcation bar works fine for me

Sent from my DROID2 using DroidForums
 
OP
M

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
Your original concept should work just fine, but here's my question: What did you use to decompile the .xmls and how did you edit them and then recompile them?

I used APKmanager to decompile and recompile. And I used Metamorph to inject everything into my existing framework-res. I have used the same process to edit my 10% battery icons, as well as my status bar xml files so I hesitate to peg those tools as the problem. flashing the theme went smoothly and im assuming if there was a problem there it would FC and/or not boot at all. Rather, i am beginning to think that there is more to the edit than just those 2 files and the different pngs.

Has anyone seen a 1% battery tutorial that they could share? ive been searching for a while but havent actually come across a how-to.
 
OP
M

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
Try battery moniter that has 1% increments for the notifcation bar works fine for me

Sent from my DROID2 using DroidForums

link? i googled "battery monitor" (im assuming moniter is a typo) and all i can find is widgets.

EDIT: I found it, but that just puts a percentage in the NOTIFICATION area, not the actual battery part.
 
Last edited:
OP
M

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
i have come to the conclusion that i dont think it's possible to get down to 1% increments.

1. there are a decent amount of D2/DX themers out there (most of whom more talented than myself) and no one has done it. coincidence? (i think not, i havent even seen 5%)
2. I was able to modify my framework w/ the UOT Kitchen tool and add a 1% battery mod, but it only shows the increments of 10.

This has lead me to believe that the issue of reading the battery level is a deeper (ROM/kernel/possibly hardware) issue and cannot be fixed through just xml editing.

If anyone has seen 5%/1% increments on a D2/DX and knows how to do it, I will GLADLY retract the above statement, but i cannot see a way to get there.
 

TheSwaggeR

Member
Joined
Jan 11, 2011
Messages
745
Reaction score
0
You can't just change what is in the XML. You'll have to do smali work and add id's. What I mean by id's is that you'll have to go through the java code and redo the id's (R.id.****) and tell it to grab the image for each increment percentage. You will also have to look in the /sys/class/power_supply/battery/charge_counter and make changes to that.

So that is 3 different areas you've got to make changes in it for it to work.
 
OP
M

mattXdezzi

Member
Joined
Feb 8, 2011
Messages
50
Reaction score
0
You can't just change what is in the XML. You'll have to do smali work and add id's. What I mean by id's is that you'll have to go through the java code and redo the id's (R.id.****) and tell it to grab the image for each increment percentage. You will also have to look in the /sys/class/power_supply/battery/charge_counter and make changes to that.

So that is 3 different areas you've got to make changes in it for it to work.

thanks. thats the answer i was looking for. it is definitely past my level of familiarity w/ android, so i will wait for a dev to put it in a rom, or until i have the time/patience to learn to do it myself.
 

randizzard

Member
Joined
Jan 17, 2011
Messages
138
Reaction score
0
I don't know if it helps any but I can get 1% increments just using the battery widget from the minimalistic text app from the market...also allows the showing of voltage and temp all in a 1x1 icon.

View attachment 31383

Was trying to show screen shot but not sure if it worked

Sent from my DROID2 using DroidForums
 

Xplorer4x4

Active Member
Joined
Mar 9, 2010
Messages
1,004
Reaction score
4
Location
Evansville,IN
i have come to the conclusion that i dont think it's possible to get down to 1% increments.

If anyone has seen 5%/1% increments on a D2/DX and knows how to do it, I will GLADLY retract the above statement, but i cannot see a way to get there.

Per yer statement on page 1, I grabbed battmonx. It does indeed use 1% battery increments.

Battmonx leads me to believe it is possible! As you all are aware when the battery state on our phones, or any android, hits 15%, a warning message appears on the screen. I noticed that while the stock battery indicator was actually displaying 20%, battmonx was dead on the money at 15%.

Also, I have investigated the /sys/class/power_supply/battery/charge_counter as mentioned here. Anytime i go to view this file it reports exactly what battmonx reports, well it may be 1% off since battmonx only monitors the battery in certain intervals. I spoke with the dev of battmonx and asked him how he achieved 1% increments for devices like the D2G. Sure enough he says the app pulls the battery percentage from the monitorscharge_counter file.

Why this has not been implemented in roms, or even an update.zip I have no idea but needless to say I believe this can be done!
 
Top