xml to code converter

Your ideas for any killerapplication that comes to your mind ;)

xml to code converter

Postby zaberrider » Sat Jul 31, 2010 2:04 pm

hey guys.

i just started developing android and coming from the qt- community i'm well aware of .xml user interface design and it's benefits. Though, first thing i noticed with android was, that android parses and compiles these xml config files at app- runtime, which is most likely very costly because there is lots of xml parsing involved (LayoutInflater.java) and in my eyes it is unuseful if preprocessing would be possible.

so... i was wondering if it would be useful, to have a tool, which would convert these xml files into java- code (for release versions at least)? i searched google for some time, but didn't find anything...

is such a tool out there?
if not... would you guys be interested in helping me develop such a thing or do you think it is not necessary? just give me some ideas and comments... *g*

greez
Zaber
zaberrider
Junior Developer
Junior Developer
 
Posts: 12
Joined: Thu Jul 29, 2010 1:20 pm

Top

Re: xml to code converter

Postby blundell » Sat Jul 31, 2010 4:27 pm

I would say not necessary.

You can write your layouts within Java if you so wish. The point of having them in XML is that the environment can select the XML file based on the screen size and phone type dpi etc so only one layout has to be parsed. Capiche?
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: xml to code converter

Postby zaberrider » Sat Jul 31, 2010 4:54 pm

blundell wrote:You can write your layouts within Java if you so wish.

yeah... and just there i see the problem (and actually the purpose of loose coupling of UI design and programming). it's not me, who designs the UI... it's some screen designer, who can use the given tools for layouts or can handle xml ;-)
but at some point i would have to convert his/her xml designs manually to java code if i want to get performance out of the application.

I encountered the problem first, when i developed a listactivity with custom and complex designed row- layout. I got the design from Graphics artists and was forced to manually convert it to java code, because else i would have to have android inflate (i.e. parse an xml file) the layout for each row which is displayed. performance in this case was absolutely horrible.

blundell wrote:The point of having them in XML is that the environment can select the XML file based on the screen size and phone type dpi etc so only one layout has to be parsed.

This is definitifly one thing to put into a future conversion tool.
zaberrider
Junior Developer
Junior Developer
 
Posts: 12
Joined: Thu Jul 29, 2010 1:20 pm

Top

Return to Creative Corner

Who is online

Users browsing this forum: No registered users and 3 guests