03-19-2010 10:33 AM
I've hardcoded all my UI till now and would like to make my UI more customizable. (Fields on a screen, data in a field, etc.)
I'm used to doing this on webapps, but I'm wondering if this is a good idea on blackberry since XML parsing seems to be an expensive task.
Can anyone provide tips on if it's a good idea / if there's some other way to do it?
Solved! Go to Solution.
03-19-2010 11:21 AM
We do this for some screens and have written, for a third party, an XML based 'interpreter' which as well as screens, allowed the XML to specify form flow and collection logic.
The performance is fine, though we do try to create the Screens once, cache them, and reuse rather than creating each time.
The biggest issue I have is that it is very difficult to tailor the screens, for example to look OK on various device's and to be able to do intelligent processing - for example to do context sensitive processing. Personally for our applications, I'm not sure that we have saved time overall.
In summary, I think for simple forms/data capture, there is value in looking at this, but for a complicated application, I'm not convinced.
But it is definitely do-able.
03-19-2010 02:13 PM
I think the answer to this question is probably the same no matter what the UI platform. I've done this with web pages. The issue is that it quickly becomes much more complicated than you would have guessed. Also, I'd say it depends highly on what you want to customize. And, as Peter said, you may be left with wondering whether you should have done it. Rather than an overall "xml framework" approach maybe you can get by with a simple property file and a bunch of "if, then, else" logic.
"as simple as possible and no simper"
03-31-2010 08:44 AM
Can u please guide me what to do for XML driven UI development for web services.
Actually I am looking for a sample in which create an XML for Login Screen parse that xml and According to parse data the Login Screen UI will get display on the Screen can any of you please guide me how to
do this stuff.
03-31-2010 08:53 AM
I can't give you anything, this is all our own code.
Below is an example Field definition, in XML, which shows you the sort of things that we do.
In simplistic terms, the Screen processing just parses the XML (using a SAX parser) and adds the Fields to the Screen, so it is not that complicated.
But it is a lot of work.
<Field type="Checkbox" label="Submitted?" name=”SubFlagField” dataName=”_subFlag” display="'Y'" bold="'Y'" size="2" update="N" > <CheckboxField default=”N” /> </Field>