Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
soundwire
Old
#1  
Member - OP
Thanks Meter 24
Posts: 57
Join Date: Jan 2009
Exclamation XML to binary XML?

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.
 
jdwme
Old
#2  
jdwme's Avatar
Senior Member
Thanks Meter 0
Posts: 462
Join Date: Apr 2008
Location: Houston
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
 
soundwire
Old
#3  
Member - OP
Thanks Meter 24
Posts: 57
Join Date: Jan 2009
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?
 
damnitpud
Old
#4  
damnitpud's Avatar
Senior Member
Thanks Meter 3
Posts: 475
Join Date: Jul 2007
Location: RI
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.
 
soundwire
Old
#5  
Member - OP
Thanks Meter 24
Posts: 57
Join Date: Jan 2009
Awesome let me know how it goes, I am also trying it in a similar way.
 
damnitpud
Old
#6  
damnitpud's Avatar
Senior Member
Thanks Meter 3
Posts: 475
Join Date: Jul 2007
Location: RI
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.
 
soundwire
Old
#7  
Member - OP
Thanks Meter 24
Posts: 57
Join Date: Jan 2009
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!
 
damnitpud
Old
#8  
damnitpud's Avatar
Senior Member
Thanks Meter 3
Posts: 475
Join Date: Jul 2007
Location: RI
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.
 
MOONSSPOON
Old
#9  
MOONSSPOON's Avatar
Senior Member
Thanks Meter 0
Posts: 247
Join Date: Feb 2009
Location: Seattle, Washington
What errors are you getting?
 
damnitpud
Old
#10  
damnitpud's Avatar
Senior Member
Thanks Meter 3
Posts: 475
Join Date: Jul 2007
Location: RI
Quote:
Originally Posted by MOONSSPOON View Post
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.

 
Post Reply+
Tags
.apk, framework, xml
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more

Boot Animation Paradise for your Android Device

The default boot animations on any device, no matter whichmanufacturer, are generally pretty … more