Any way to make battery icon image update every 10% rather than every 20%?
This is a discussion on Any way to make battery icon image update every 10% rather than every 20%? within the cvpcs forums, part of the Droid Forums Dev Archives category; Just an update -- I'm having problems adding more additional icons to make a resultant framework file. No I haven't abandoned my efforts or just ...
Just an update -- I'm having problems adding more additional icons to make a resultant framework file. No I haven't abandoned my efforts or just wanted to keep everyone hanging (although due to work I can't work on this everyday). I contacted the developer of APKManager since this is a problem with the build. For right now I'm going to try to hopefully find a hack around this problem.
I got it... thanks to kalpik, the trick was to copy the META-INF folder and AndroidManifest.xml from the original framework-res.apk to the compiled one!, I got it in 10% increments!
1. Copy framework-res.apk
2. Decompile it with APK Manager 4.8
3. Paste the ... xml files in drawable and the png files in drawable-hdpi-v4.
4. Compile the apk
5. Copy META-INF folder and AndroidManifest.xml from the original APK to the modded one
APK Manager: Option 9 (decompile) and option 11 (compile).
7zip: To copy the original files to the modded one.
Then create an update.zip with the framework-res.apk in it and install with recovery.
Just an fyi -- you only need to compile the framework additionally for any xml changes. You don't need to do for simple png or image changes. And you don't necessarily need an update.zip. An alternative is to simply push with adb and then reboot.
Ive included a screencap -- (Man I need more battery quick!!)
Just an fyi -- you only need to compile the framework additionally for any xml changes. You don't need to do for simple png or image changes. And you don't necessarily need an update.zip. An alternative is to simply push with adb and then reboot.
Ive included a screencap -- (Man I need more battery quick!!)
kevdog, Im on CM and I used an edited xml file and added the pngs but they wouldnt display properly. Could you help me out with getting these 10% pngs?!
I decided to play with this more and figured it out after reading some of the suggestions posted in this forum. Heres the framework-res.apk for everyone else running sapphire.
Directions to install
1. Reboot the phone into recovery
2. adb push framework-res.apk to /system/framework
3. Reboot the phone and you should now see the 10% icons! You can change the png files inside the framework to anything you want, these are just some basic ones I made using pete's as a base.
Update.zip can be installed the same way a rom is... Note that this replaces your services.jar with a modified one to allow transparent images. Download update.zip
Let me know if you have any problems installing.
[Edit]
I forgot to say that this apk also adds a transparent notification bar as long as your services.jar is patched... transparent png credit to pete.
Last edited by lrgraham14; 08-27-2010 at 04:13 PM.
One of the pitfalls with this approach is that if you want to apply a theme after applying this hack, the new custom framework-res.apk (containing the 10% battery) will be overwritten with the themed framework-res.apk -- hence losing the 10% battery effect. Essential for this hack to work is both the stat_sys_battery.xml file along with the resources.arsc file. The actual png icons can be added later at any time.
I wish there was a way to distribute a framework-res.apk file that made it possible only to update changes (call it a partial framework-res.apk update), rather than distribution of the entire framework-res.apk. That way only the updated portions of the framework could be updated, leaving any themed parts behind. The problem however arises if the theme creator modified the resources.arsc in any way.
Possibly the best way to distribute these two files would be either individually (which could then be applied using ninjamorph) or as a metamorph file. I'm not the biggest fan of either approach, however they would allow others to install this hack over a themed ROM (possibly).
The sure fire method would be to ask theme creators to create their themes with the ability to have custom 10% icons. That would probably be the best way (or have cvpcs add this in when the entire ROM is compiled -- which I'm betting has virtually no chance.).
One of the pitfalls with this approach is that if you want to apply a theme after applying this hack, the new custom framework-res.apk (containing the 10% battery) will be overwritten with the themed framework-res.apk -- hence losing the 10% battery effect. Essential for this hack to work is both the stat_sys_battery.xml file along with the resources.arsc file. The actual png icons can be added later at any time.
I wish there was a way to distribute a framework-res.apk file that made it possible only to update changes (call it a partial framework-res.apk update), rather than distribution of the entire framework-res.apk. That way only the updated portions of the framework could be updated, leaving any themed parts behind. The problem however arises if the theme creator modified the resources.arsc in any way.
Possibly the best way to distribute these two files would be either individually (which could then be applied using ninjamorph) or as a metamorph file. I'm not the biggest fan of either approach, however they would allow others to install this hack over a themed ROM (possibly).
The sure fire method would be to ask theme creators to create their themes with the ability to have custom 10% icons. That would probably be the best way (or have cvpcs add this in when the entire ROM is compiled -- which I'm betting has virtually no chance.).
I agree completely, Chevy has been working on a script to update the internal files of apk files using an update.zip script. However i think you will run into problems when applying it to different framework files. Basically the best way to apply this hack right now is manually for a custom theme. Hopefully someone will figure out a simple way to apply this for any theme!
The sure fire method would be to ask theme creators to create their themes with the ability to have custom 10% icons. That would probably be the best way (or have cvpcs add this in when the entire ROM is compiled -- which I'm betting has virtually no chance.).
Doesn't hurt to ask, I'd say - file an enhancement request on the bugtracker. Sounds like you've done a lot of the legwork, which is certainly several levels above just "hey include this in sapphire".