I haven’t wrote almost anything about the development of my first App launched on the App Store: SA2010SS. Now it’s time for a little about that…
I’m picking up that code to reuse it on the next App, which will be similar but this time, based on the National Soccer League(s) with the addition of one or two interesting features, I hope.
This post is focused on the strategy that I used for our App’s main interface and data updates.
Starting by the data updates, our App gets the data from the server, downloading three XML files, each one with:
- match results;
- standings;
- best scorers.
For the user interface I’ve used some standard iPhone controls (mainly for buttons) but the main screen is almost filled with an UIWebView.
What that means?
That means that the mainly part of our App UI is done using standard HTML web pages. I had some problems to implement this “workflow”, but after achieving that, it allowed us to easily tune our UI, using standard web technologies: HTML + CSS.
The main pages/views are obtained via XSLT:
XML -> XSLT (with CSS) applied -> HTML
So, when the App updates data, it receives three XML files, the correspondent XML data for the screen that the user is seeing, is transformed applying a corresponding XSLT file and then the new HTML page is generated and presented on the UIWebView.
I know this method is not so fast as if I had only used iPhone controls from the UIKit Framework for the views. But the pages scroll and transitions are fluid, except on the first time the App creates and presents each view, which take maybe 2 or 3 seconds do appear.
That’s not perfect, but it was a nice trade-off which allowed us to cut some time (that would be used to learn to use those controls) on our App development and design.
Nevertheless, in the future maybe it’ll be easily to port it to Android OS or any other platform which supports web views.
I’d like to hear your opinions and suggestions about this scheme or better alternatives. Leave me a comment…
October 18, 2011 at 10:35
Hi,
I’m working on an iPhone app that could really use XSLT to transform some quite scary XML into something presentable, but from what I read here, there and everywhere, Apple will reject an app that uses libxslt because it is implemented as a dynamic library. How did you get around this in your app.
Cheers
Mike
October 23, 2011 at 15:54
Mike, I haven’t used any library, only plain XML and XSL files that are transformed on HTML.
Soon (when I’ve the time)… I’ll write “you” a small post with an example taken from our App code files.
Keep going on…
Ricardo
October 24, 2011 at 19:17
Hi Ricardo,
Can u please post me an sample app for XSL. It would be really helpful.
Thanks
Ravz
November 1, 2011 at 07:18
Hi Ricardo, can you please send me the sample app code which you mentioned in your post dated October 23rd,2011 3.54pm. I am developing application for ipad where I am fetching xml data from web service and parsing it with NSXMLParser. I want to omit the parsing process and would like use your approach. Please help me in this.
Thanks.
November 8, 2011 at 01:41
rav and Harshal Joshi, you can get the sample files from my last post:
App Interface – Example of HTML Generation from XML and XSLT
Sorry, for the delay on my response but I’ve been working on our next App for Christmas time, we hope! 😉