FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

XML to binary XML?

57 posts
Thanks Meter: 25
 
By soundwire, Member on 14th February 2009, 08:21 PM
Post Reply Email Thread
So I've been trying to figure out how to convert or build a .xml file from the sdk into a binary xml to replace some of the layout files in framework.apk. I have had no luck though. Does anyone know how this can be done or has been done.
 
 
14th February 2009, 09:16 PM |#2  
jdwme's Avatar
Senior Member
Houston
Thanks Meter: 0
 
More
Here's a sticky about xml edits from the top of this section

That's where you'll wanna start or get in touch with stericson about it
14th February 2009, 09:30 PM |#3  
OP Member
Thanks Meter: 25
 
More
thanks, although I have read it. It seems he has only been able to hex edit the binary files. Shouldn't we be able to build just the binary files from the original non-binary file, add it to framework-res.apk, re-sign, and update?
15th February 2009, 12:28 AM |#4  
damnitpud's Avatar
Senior Member
Flag RI
Thanks Meter: 7
 
More
I am actually working on this. I downloaded the source which has xmls in normal xml. If you import them into an android app in eclipse it will convert them to binary format. I haven't tested this yet though. Not sure the source has the exact same xmls.
15th February 2009, 01:17 AM |#5  
OP Member
Thanks Meter: 25
 
More
Awesome let me know how it goes, I am also trying it in a similar way.
16th February 2009, 08:09 AM |#6  
damnitpud's Avatar
Senior Member
Flag RI
Thanks Meter: 7
 
More
Well i tried for a few hours last night, but eclipse was complaining about different things not found...sucks. i need to study up more on Java programming.
16th February 2009, 05:04 PM |#7  
OP Member
Thanks Meter: 25
 
More
I tried editing and building from source...it did not work however i used sdk 1.0r2 and not 1.1 so i think that may have had something to do with it. I'm gonna try again but it takes so damn long!
16th February 2009, 05:33 PM |#8  
damnitpud's Avatar
Senior Member
Flag RI
Thanks Meter: 7
 
More
build from source? we can only build cupcake. i've been trying to edit the xmls from source and then compiling them in eclipse. But i keep getting errors.

I have been playing with the stat_sys_battery.xml

the default is:
Code:
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:maxLevel="4" android:drawable="@android:drawable/stat_sys_battery_0" />
    <item android:maxLevel="14" android:drawable="@android:drawable/stat_sys_battery_10" />
    <item android:maxLevel="29" android:drawable="@android:drawable/stat_sys_battery_20" />
    <item android:maxLevel="49" android:drawable="@android:drawable/stat_sys_battery_40" />
    <item android:maxLevel="69" android:drawable="@android:drawable/stat_sys_battery_60" />
    <item android:maxLevel="89" android:drawable="@android:drawable/stat_sys_battery_80" />
    <item android:maxLevel="100" android:drawable="@android:drawable/stat_sys_battery_100" />
</level-list>
I tried adding some, then compiling the images and xml in Eclipse but it is throwing errors and wont convert it to binary.

Code:
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:maxLevel="4" android:drawable="@android:drawable/stat_sys_battery_0" />
    <item android:maxLevel="14" android:drawable="@android:drawable/stat_sys_battery_10" />
    <item android:maxLevel="29" android:drawable="@android:drawable/stat_sys_battery_20" />
	<item android:maxLevel="39" android:drawable="@android:drawable/stat_sys_battery_30" />
    <item android:maxLevel="49" android:drawable="@android:drawable/stat_sys_battery_40" />
	<item android:maxLevel="59" android:drawable="@android:drawable/stat_sys_battery_50" />
    <item android:maxLevel="69" android:drawable="@android:drawable/stat_sys_battery_60" />
	<item android:maxLevel="79" android:drawable="@android:drawable/stat_sys_battery_70" />
    <item android:maxLevel="89" android:drawable="@android:drawable/stat_sys_battery_80" />
	<item android:maxLevel="99" android:drawable="@android:drawable/stat_sys_battery_90" />
    <item android:maxLevel="100" android:drawable="@android:drawable/stat_sys_battery_100" />
</level-list>
I know i have to add the names of the images as strings or attr but im not finding where i have to do that.
16th February 2009, 08:25 PM |#9  
MOONSSPOON's Avatar
Senior Member
Seattle, Washington
Thanks Meter: 0
 
More
What errors are you getting?
16th February 2009, 10:06 PM |#10  
damnitpud's Avatar
Senior Member
Flag RI
Thanks Meter: 7
 
More
Quote:
Originally Posted by MOONSSPOON

What errors are you getting?

there is an aapt problem. ERRor Error: Resource is not public. (at'drawable' with value '@android:drawable/stat_sys_battery_20')

It has the error for each image. I am learning about Java programming but i haven't gotten this deep into it yet.
18th February 2009, 09:00 PM |#11  
OP Member
Thanks Meter: 25
 
More
it seems that we need to add all the strings and images for it to build right. im going to try it tonight... or find a way to build it with the errors just to get the xml converted.
Post Reply Subscribe to Thread

Tags
.apk, framework, xml

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes