Jump to content

[mod] Display battery percentage in battery icon


Recommended Posts

Guest azuwis
Posted (edited)

Credit goes to original authors, canadiancow and jeagoss.

For more info see http://github.com/CyanogenMod/android_fram...d89aaac4036f257

My simplified patch against android-2.2_r1.1 here http://github.com/azuwis/android_framework...38f1615b1ab8889

How to flash: download , unpack, and

services_froyo91_mod.zip

adb remount

adb pull /system/framework/services.jar services.jar

adb push services-froyo91-mod.jar /system/framework/services.jar

adb reboot

Screenshot:

post-702447-1280225745_thumb.png

Note: Not heavily tested, no idea if it will cause any problem.

Update:

Add mod for 1.100.39 based black-themed ROMs(LCR 1.8, Galaxyquid, etc). Only tested on Galaxyquid theme on stock 1.100.39.

Compared services.jar from LCR 1.8, It turned out that it's the same as the one I worked with. So, It should work.

Some one brave enough to try this please provide feedback.

Please use mod in update3 instead.

services_1.100.39_mod.zip

Update2:

Mod for white-themed ROMs(stock) is coming done. Thanks to elban for the feedback.

services_1.100.39_mod_white.zip

Update3:

Really display 99% when battery level is 100% this time. For black-themed 1.100.39.

Source code changes: http://github.com/azuwis/android_framework...10f9659cc0d2ae6

services_1.100.39_mod_black.zip

PS: Found a interesting post on xda http://forum.xda-developers.com/showthread.php?t=723356, someone managed to implement this only by modifying framework-res.apk

Edited by azuwis
Guest G_Technik
Posted

Is it possible to make it work on Eclair?

Guest CedricGatay
Posted

Only issue encountered so far, when battery level is at 100%, it shows 10, there is not enough room available for the entire string.

Good job !

Guest azuwis
Posted (edited)
Is it possible to make it work on Eclair?

It should be possible. I don't have a Liquid running Eclair, and don't want to flash the phone for now, so...

Only issue encountered so far, when battery level is at 100%, it shows 10, there is not enough room available for the entire string.

Good job !

According to the code:

if (data.number == 100) {

	nv.setText("" + 99);

} else if ((data.number > 0)&&(data.number < 100)) {

	nv.setText("" + data.number);

} else {

	nv.setText("");

}

when battery level is 100%, it should show 99. I guess the phone report a value greater than 100. I'll try `data.number >= 100`.

Weird, this should not happen.

Edited by azuwis
Guest Calcvictim
Posted

so did anyone try this yet on the LCR roms?

Guest L0cu7us
Posted
when battery level is 100%, it should show 99. I guess the phone report a value greater than 100. I'll try `data.number >= 100`.

Weird, this should not happen.

what about if level>99 string = "[]" ?

Guest khamees79
Posted

I tried in LCR 1,8 , Negative

Hope somebody can fix it

Guest azuwis
Posted

Updated with mod for 1.100.39 based ROMs, see OP.

Guest elban
Posted

thanks!

tried the 1.100.39 version on my vanilla, seems to be working but it changed my notification bar font color to white on white, which is hardly readable

Guest azuwis
Posted
thanks!

tried the 1.100.39 version on my vanilla, seems to be working but it changed my notification bar font color to white on white, which is hardly readable

My bad. Presumed services.jar from stock 1.100.39 and other ROMs are the same.

Black-themed and white-themed ROMs should be patched against separately.

Guest L0cu7us
Posted

tested on my lcr 1.8 with theme galaxyliquid for xian 0.9 and it seems to work ok, when in charge it doesn't show %, is this ok ?

BTW: galaxyliquid theme does change services.jar !

Guest azuwis
Posted
tested on my lcr 1.8 with theme galaxyliquid for xian 0.9 and it seems to work ok, when in charge it doesn't show %, is this ok ?

BTW: galaxyliquid theme does change services.jar !

No % when in charge, it's supposed to be that.

Guest vanahaim
Posted

It´s possible to make a version for black statusbar (1.100.39)? Thanks!

Guest azuwis
Posted
It´s possible to make a version for black statusbar (1.100.39)? Thanks!

The current mod is for black statusbar.

Guest Rippan
Posted

screenshotoca.png

Doesn't fit perfectly on LCR 1.8, at least not for me.

Guest Apocangel
Posted

The one you mentioned that only changes the framework-res.apk is just a workaround. They just included 100 PNGs with number.

The services.jar for .39 works on my phone but the numbers are a little too small. Could be the custom font im using though.

Im running LCR 1.8 with the 998Mhz kernel and my own Green Theme.

Guest L0cu7us
Posted
Im running LCR 1.8 with the 998Mhz kernel and my own Green Theme.

screenshot ?

Guest Rippan
Posted (edited)
http://yfrog.com/j9hjqp

this is mine with galaxyliquid for xian 0.9 (on lcr 1.8)

I guess it's the LCR 1.8 original battery icon that is too small.

gyjghjghj.png

Edited by Rippan
Guest HustlinDaily
Posted
http://yfrog.com/j9hjqp

this is mine with galaxyliquid for xian 0.9 (on lcr 1.8)

Were there any extra steps you took than the ones mentioned in the first post?

Guest L0cu7us
Posted
Were there any extra steps you took than the ones mentioned in the first post?

Installation path:

lcr 1.8->galaxyliquid theme for xian 0.9/1.0->patch for % on notification bar

Guest elban
Posted
I guess it's the LCR 1.8 original battery icon that is too small.

gyjghjghj.png

I have the same "10 <CR> 0" problem on vanilla 1.100.39

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.