# xml drawable id question



## alatedseraph (Jan 23, 2012)

so im taking my first stabs at xml editing and my question is how do i add a new png to the values/public xml?

I dont understand what it means by id. To me it looks like its a random or sequential number assigned to each drawing for lookups but i tried adding a couple new lines with the new pngs and new unique ids and it wont accept them.


----------



## Fatsix (Dec 19, 2011)

I think they are auto assigned when compiled. But they need to be included in plurals. I'd like to know myself. It would be better to ha e source code, edit that and not worry about XML BS.

Sent from my Galaxy Nexus using RootzWiki


----------



## alatedseraph (Jan 23, 2012)

well i figured out that the issue is my entry index is larger than the available symbols, anyone tell me how to fix that?


----------



## killabyte (Jan 22, 2012)

I'm interested in finding out about this as well. Compiling an .apk and getting multiple entry index is larger than available symbols error.


----------



## alatedseraph (Jan 23, 2012)

anyone come on people we need some help >.>


----------



## Schoat333 (Jun 14, 2011)

What exactly are you trying to do? What do you want to add images for?


----------



## alatedseraph (Jan 23, 2012)

killabyte said:


> I'm interested in finding out about this as well. Compiling an .apk and getting multiple entry index is larger than available symbols error.


i found out that the public xml is updated on its own by the apktool! thanks zaphod! If you have changed some names make sure to go into the public and just erase the entries that you changed it will update it!


----------



## killabyte (Jan 22, 2012)

That was my problem as well. Thanks for letting me know


----------



## killabyte (Jan 22, 2012)

It fixed my problem compiling the apk but my mods didn't work. I changed the battery stats and charging files. If I add the extra steps for 1% increments into the public xml file I get those errors on recompiling but if I delete the public xml and let it rebuild it I don't get them but then the images don't show up. It still shows the factory images. I'm on a factory rooted and deodexed 4.0.2


----------



## alatedseraph (Jan 23, 2012)

did you remember to move over the resource file and the folders changed over to the old apk?


----------



## killabyte (Jan 22, 2012)

i copied all the stat_sys_battery_0 - 100 and stat_sys_battery_charge_anim0 - 100 files into res/drawable/xhdpi and there were 2 xml files i copied into drawable called stat_sys_battery and stat_sys_battery_charge. i made an update.zip and put my script together and signed it and then flashed with clockwork.


----------



## alatedseraph (Jan 23, 2012)

killabyte said:


> i copied all the stat_sys_battery_0 - 100 and stat_sys_battery_charge_anim0 - 100 files into res/drawable/xhdpi and there were 2 xml files i copied into drawable called stat_sys_battery and stat_sys_battery_charge. i made an update.zip and put my script together and signed it and then flashed with clockwork.


did you make sure to clear dalvik? and the best i can say is you edited the xmls wrong if all the pngs are set up properly.


----------



## killabyte (Jan 22, 2012)

i did not clear the dalvik and the images i copied from "HON3YSCR3AM_AXI0M_3DITION_ALT". does it matter if the images come from a 4.0.3 rom since i am running on 4.0.2 (deodexed)? i'll try clearing the dalvik cache now.


----------



## alatedseraph (Jan 23, 2012)

you might wanna check to make sure the spelling is proper between the xmls and the pngs.


----------



## killabyte (Jan 22, 2012)

just cleared the dalvik and regular cache, no go. on the spelling note i noticed i decompiled SystemUI.apk into systemui folder and then recompiled it in lower case. maybe thats my problem since *nix file systems are case sensitive.


----------



## alatedseraph (Jan 23, 2012)

yea that can cause problems, when u installed it theres probably 2 systemui.apks in the folder now you can check with root explorer.


----------



## killabyte (Jan 22, 2012)

yup there are 2... pretty stupid of me i knew better than that. i think i'll start over and re-do the whole process in case something got renamed improperly from me decompiling and recompiling in lower case. i'll report back in a bit. btw thanks for your help man


----------



## mbh87 (Jun 14, 2011)

killabyte said:


> yup there are 2... pretty stupid of me i knew better than that. i think i'll start over and re-do the whole process in case something got renamed improperly from me decompiling and recompiling in lower case. i'll report back in a bit. btw thanks for your help man


just rename the apk and flash it again, should be good to go


----------



## killabyte (Jan 22, 2012)

I restarted what I was doing. I copied the battery stats and animation files into /res/drawable-xhdpi. There's a thread (http://rootzwiki.com...284#entry357284) where runandhide posts a zip file containing info for how to use the 1% increments. As stated earlier if I manually put the values into public.xml it wouldn't compile but leaving it out works, it adds the values for you. But there are 2 other files in the zip that say you put them into /drawable, they are stat_sys_battery.xml and stat_sys_battery_charge.xml.

So I deleted my public.xml and copied the other 2 xml files into /drawable. I double checked everything and zipped it up, signed and flashed it. I'm still not getting the battery indicator I used. It's using the factory images and I don't understand how because I overwrote those with the newer files i'm using. I don't think it's a problem with the .png files because I am using the battery .png's from "HON3YSCR3AM_AXI0M_3DITION_ALT" theme.

There's a drawable-sw600-xhdpi folder that has the original battery png files in it. Am I supposed to overwrite those too?

*edit* I also deleted dalvik-cache and cache before flashing.


----------



## killabyte (Jan 22, 2012)

i'll be damned if i know what's up... i've done everything i can think of. this last attempt i deleted public.xml. i copied stat_sys_battery and stat_sys_battery_charge xml files to /drawable overwriting the ones already there. then i copied the battery png images to /drawable-xhdpi AND into drawable-sw600dp-xhdpi. compiled it, signed it, wiped dalvik and cache and flashed and i'm STILL getting the stock images. i dont know where they're coming from now.


----------



## Schoat333 (Jun 14, 2011)

killabyte said:


> i'll be damned if i know what's up... i've done everything i can think of. this last attempt i deleted public.xml. i copied stat_sys_battery and stat_sys_battery_charge xml files to /drawable overwriting the ones already there. then i copied the battery png images to /drawable-xhdpi AND into drawable-sw600dp-xhdpi. compiled it, signed it, wiped dalvik and cache and flashed and i'm STILL getting the stock images. i dont know where they're coming from now.


How are you recompiling the apk?

Are you copying your new resources.arsc, images, and xml's into the original apk?


----------



## killabyte (Jan 22, 2012)

Hmm maybe i've been half stepping. I've been using apktool and doing apktool b SystemUI. Then in my decompiled SystemUI dir there's been a dir named dist that had the apk in it... am i supposed to take the stuff in the build folder and add it into the apk?


----------



## killabyte (Jan 22, 2012)

When I recompile the apk those files are already added to it aren't they? Just in case I took the stuff in the "build" dir and put it into the original apk using 7zip and it still isn't working. What am I doing wrong? Is there something in the framework-res i'm supposed to edit as well?


----------



## alatedseraph (Jan 23, 2012)

in the dist folder is the new built apk, open that with 7zip and the original apk with 7zip and move the resources file and any folders that you changed into the old apk and use it.


----------



## killabyte (Jan 22, 2012)

Tried all of that man. It's just not working. I'm thinking there must be some problem with those xml edits i'm using that were posted. Either that or it's got something to do with the framework. I just don't understand what it is i'm missing.

I just tried something completely different. I took my original SystemUI.apk and did nothing but open it in 7zip and placed the corresponding png images into it, stat_sys_battery_0, 15, 28, 43, 57, 71, 85 and 100. That's all I did. Copied it over, rebooted and deleted dalvik and cache and then rebooted again. Still have the same ol factory images.

I don't know where it's pulling the images from.


----------



## Schoat333 (Jun 14, 2011)

killabyte said:


> Tried all of that man. It's just not working. I'm thinking there must be some problem with those xml edits i'm using that were posted. Either that or it's got something to do with the framework. I just don't understand what it is i'm missing.
> 
> I just tried something completely different. I took my original SystemUI.apk and did nothing but open it in 7zip and placed the corresponding png images into it, stat_sys_battery_0, 15, 28, 43, 57, 71, 85 and 100. That's all I did. Copied it over, rebooted and deleted dalvik and cache and then rebooted again. Still have the same ol factory images.
> 
> I don't know where it's pulling the images from.


If your renaming the png's, but they are not showing, it sounds like your script is not flashing properly.

Try placing your apk in the system/app folder in this zip, then flash in cwm.

https://dl-web.dropbox.com/get/flash%20in%20cwm.zip?w=32b5aacc


----------



## killabyte (Jan 22, 2012)

I'm not renaming the png files. My script works fine for copying the apk file over to /system but the last few times I just pushed it over to cut out an extra step. I spoke with a themer about it and we both think the images have to be coming from somewhere else since i'm on a 4.0.2 rom.


----------

