Any way to make battery icon image update every 10% rather than every 20%?

chevycam94

SteelDroid ROM / Cortex ROM Developer
Developer
Joined
May 12, 2010
Messages
1,616
Reaction score
153
Location
Central Ohio
Website
steelroms.com
Current Phone Model
Nexus 6P, VZW Note Edge, D1
OK, I am making my own custom ROM, and slowly adding features as I learn them. Right now, 10% battery icons and status. I UNDERSTAND how it works, but for some reason my APK Tool setup and my APK Manager 4.8 setup, always give errors when trying to recompile anything. Cant get either to work for the life of me. DEcompiling works perfectly, as far as I can tell.

I have attached a copy of the files I am working with. Inside you will find:

* framework-res.apk (the one that is from my ROM right now, where I need the modified files to be placed after being compiled)
* stat_sys_battery.xml (decompiled, edited)
* stat_sys_battery_charge.xml (decompiled, edited)
* strings.xml (decompiled, edited)
* All the 10% battery icons (credit to liquid, pulled from his LFY ROM for the moment)

If someone could recompile, and make a final framework-res.apk for me, that would be great. If you want to test it, its from FRG22 base (what my ROM is going to be using as its base, NOT A SOURCE BUILD!)

At the very least, recompile the XML's and I can stuff them back into a freshly pulled framework-res.apk, and push back to the phone, like I have done before.

I dont know, but maybe this helps: Its my error log from APK Manager. Whats going on?

Code:
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
    at brut.androlib.Androlib.readMetaFile(Unknown Source)
    at brut.androlib.Androlib.build(Unknown Source)
    at brut.androlib.Androlib.build(Unknown Source)
    at brut.apktool.Main.cmdBuild(Unknown Source)
    at brut.apktool.Main.main(Unknown Source)
Caused by: brut.directory.PathNotExist: apktool.yml
    at brut.directory.AbstractDirectory.getFileInput(Unknown Source)
    ... 5 more
 
Last edited:

iamlost87

Member
Joined
Apr 5, 2010
Messages
56
Reaction score
0
Once you recompile the apk however, that is were I get off the bus. I then just go into the compiled apk, and simply then just take the individually modified xml files out and add them back into the original apk file using winrar/winzip (similar to when do framework-mods where dropping images into the hdpi-drawable file). I then push back the modified original apk either as an update.zip file, or use adb and reboot.

This is exactly what I did. I decompiled using APKTool, edited the stat_sys_battery.xml, added the images neccesary, then recompiled. I then pulled that xml and the images from that new framework and popped them in the framework from a fresh download of vanilla sapphire. This should work... I'm on BB, but I'm gunna make a back-up and save. I don't know why this isnt working, but I'm about to find out.
 

microsnook

Active Member
Joined
Feb 8, 2010
Messages
1,291
Reaction score
0
Once you recompile the apk however, that is were I get off the bus. I then just go into the compiled apk, and simply then just take the individually modified xml files out and add them back into the original apk file using winrar/winzip (similar to when do framework-mods where dropping images into the hdpi-drawable file). I then push back the modified original apk either as an update.zip file, or use adb and reboot.

This is exactly what I did. I decompiled using APKTool, edited the stat_sys_battery.xml, added the images neccesary, then recompiled. I then pulled that xml and the images from that new framework and popped them in the framework from a fresh download of vanilla sapphire. This should work... I'm on BB, but I'm gunna make a back-up and save. I don't know why this isnt working, but I'm about to find out.

Awesome! Im standing by.

I have some battery images ready to go lol

EDIT: chevy, maybe if the guy above me gets it working you can ask him how its done!
 

iamlost87

Member
Joined
Apr 5, 2010
Messages
56
Reaction score
0
Awesome! Im standing by.

Keep standing by lol. I texted my gf to let her know i would be messing with my phone so it will be off for a bit and she of course had a laundry list of things she needed to tell me first...:icon_rolleyes:

Getting to it right now.
 

chevycam94

SteelDroid ROM / Cortex ROM Developer
Developer
Joined
May 12, 2010
Messages
1,616
Reaction score
153
Location
Central Ohio
Website
steelroms.com
Current Phone Model
Nexus 6P, VZW Note Edge, D1
Awesome! Im standing by.

Keep standing by lol. I texted my gf to let her know i would be messing with my phone so it will be off for a bit and she of course had a laundry list of things she needed to tell me first...:icon_rolleyes:

Getting to it right now.


If you have a fully working APK Manager, could you maybe help me and see why Im getting an error on compile? WinXP is what I run. take your time. :-D
 

microsnook

Active Member
Joined
Feb 8, 2010
Messages
1,291
Reaction score
0
Awesome! Im standing by.

Keep standing by lol. I texted my gf to let her know i would be messing with my phone so it will be off for a bit and she of course had a laundry list of things she needed to tell me first...:icon_rolleyes:

Getting to it right now.

Its getting worked on, thats what counts!
I have all night! lol

I hope you can get it working for sapphire people : )
 

lowboy

Member
Joined
Jun 5, 2010
Messages
207
Reaction score
0
I do too. I was rather confused and thought I may have been seeing things................LOL
Edit: I understand it's actually the battery image not the %'s.
My bad. I'm old and slow.
 
Last edited:

iamlost87

Member
Joined
Apr 5, 2010
Messages
56
Reaction score
0
I'm actually trying to get it for sapphire, bugless doesn't support 10% intervals. I flashedd sapphire and noticed what you are talking about. Its not showing images at all. Beyond editing the xml that calls the images, idk what else to do. Its not even displaying the images that were pre-existing so its not like it has anything to do with the new ones not being defined... I think we need a dev to givesome input. I really don't know what else to do.
 

microsnook

Active Member
Joined
Feb 8, 2010
Messages
1,291
Reaction score
0
I'm actually trying to get it for sapphire, bugless doesn't support 10% intervals. I flashedd sapphire and noticed what you are talking about. Its not showing images at all. Beyond editing the xml that calls the images, idk what else to do. Its not even displaying the images that were pre-existing so its not like it has anything to do with the new ones not being defined... I think we need a dev to givesome input. I really don't know what else to do.

Sniffle? Anybody?!

I hope this works out
 

cupfulloflol

Senior Member
Joined
Dec 5, 2009
Messages
1,892
Reaction score
22
I tried a few months back to be able to decompile and recompile, but failed. Well actually I can decompile fine, with apktool and apk manager, but the recompiling errors out. I got frustrated and gave up haha.

But indeed I would love to see 10% opposed to 20%, with 15% and 5% as well if possible.
 

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
Working on it guys. This aapk manager doesn't compile for me on winxp. I've contacted the developer and will try with Ubuntu later tonight.
 

chevycam94

SteelDroid ROM / Cortex ROM Developer
Developer
Joined
May 12, 2010
Messages
1,616
Reaction score
153
Location
Central Ohio
Website
steelroms.com
Current Phone Model
Nexus 6P, VZW Note Edge, D1
Working on it guys. This aapk manager doesn't compile for me on winxp. I've contacted the developer and will try with Ubuntu later tonight.

If you figure out why it wont compile, let me know. Im also running WinXP. Wont compile for me either. :icon_evil:
 

Coolsaber57

Member
Joined
Jan 7, 2010
Messages
345
Reaction score
0
Hi guys,

I've been working on a similar port - the 100 increment "Super Battery." I have been having NO luck making it work (getting boot loops) but I have gotten the .apk built and signed with no errors with APKtool.

I talked to ChevyNo1 about this (he has a working 10% incremental battery in his rom) and he said that there are issues when you get past 10% (he was trying 5% increments). Still not sure why that's a problem, the Desire and Incredible folks have it working for them...not sure what the difference is.

Just a tip: Use a completely stock framework-res.apk, meaning NOT themed, then re-add your other modded images after it's built, it will make your life a LOT easier dealing with APKtool.

Also, you *may* need to declare the extra images in the Public.xml file under the "/res/values/" folder and give them unique IDs, just make sure that the unique ID is the last of the "drawable" type. You'll see what I mean once you get into the file.

Good luck guys, if you figure out the secret, let me know! lol
 

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
Thanks for the heads up about the themed rom. I totally forgot that and I should have remembered that

Update -- OK great Ive managed to get the Apk Manager up and running in winxp. Just need the whole adb, aosp thing installed, and apk manager as pre-requisites. Ive done a couple of test builds using the stock framework-res.apk (very important!!!), and modified eri.xml by decompiling and then recompiling, and then taking the newly compiled xml and dropping it into winrar to add to the stock framework. I didnt try the sign and install method. Now that the test runs are successful hopefully I can get cracking on this battery (and maybe from help from Chevy).
 
Last edited:
Top