Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Mobile

The iPhone Application Builder


Refining the Design

Once I had a viable end product design, I turned my attention to the configuration application or "builder" app. I knew that the schema for this part would be pretty straightforward. There were going to be iPhone solutions that contained forms, and those forms would contain objects.

I decided early on that I wanted to add a layer of automation that would create all the required forms for a particular solution on-the-fly so they could be easily changed. That meant I needed to create a flexible data repository to make all the form objects nearly as configurable as they are in the "regular" Servoy Developer.

Luckily, Servoy makes this easy by giving you the ability to create forms and objects programmatically—with all the same properties and functions they have when you use the Servoy IDE.

I don't know about you, but when I'm working on a blue sky personal project like this, I want to create something that I would use. And because I had the luxury of not having a deadline, a set of hard requirements, or stakeholders and end users to please, I had a lot of flexibility.

Figure 4: The application on the iPhone looks the same as it does in the builder's "preview" window.

I started with the basics. Create a solution. Create a form. Put form objects on the form. Generate the Servoy forms programmatically, check on iPhone.

I was really amazed at how quickly it all came together. I spent maybe 20 hours and about 800 lines of code getting the basics of both the builder application and the deployed iPhone application to work.

Alas, I then made the "mistake" of showing it to some colleagues and told them how easy it was to create some basic applications. They immediately fell in love with it—and then the change and enhancement requests came flooding in.

Figure 5:Your iPhone application can have edit fields—and will even automatically support separate edit fields with the ">" at the end of each line—like the built-in "Contacts" application.

At that point, I decided that because the basic concept was sound and the application was basically functioning, it was worth the time and effort to turn it into a full-blown, detailed application.

I added features such as reordering the forms and objects, added support for most of the object types that Servoy supports (text fields, text area, HTML areas, labels, buttons, and so on) and even added two custom objects—a Navigation Item and Spacer that were a result of not wanting to create a bunch of separate labels and graphics every time I wanted a navigation item.

As I continued to build iPhone applications for myself, I found I needed to show related data, filtered data, related value lists, and the like. So most of the time that has gone into the application has been spent in sandboxing all the GUI elements to make sure that users don't accidentally go astray. I wanted to make it as "user-proof" as possible.

As you've likely experienced, it takes more coding to make an application easy and smart than it does to rely on users entering the right thing in the right spot. The good news is that I don't have to write all the guts of the code as well, only the application logic and error checking. All the heavy lifting of database connections, data broadcasting, client state, HTML generation, AJAX calls, and the like is handled by Servoy.

As of this writing, the application is still technically in late alpha, but if you would like to check it out, you can download the free Community Edition of Servoy (www.servoy.com) and my iPhone Application Builder from Dr. Dobb's (see www.ddj.com/code/).


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.