Tabs Eleven - How it Works
It all starts with an empty tab view on your iPhone or iPod Touch. This view is what is known in the iPhone SDK as a UIWebView. Basically a simple buttonless web browser. In this case pre-programmed to hit a certain url set up in the mobile device preferences. The URL would be the index page of the API you downloaded here. In our provided sample we used PHP. This can be changed to the server codebase of your choice as you can change the index page name, page suffix and actual URL in the iPhone.
The Tabs Eleven API code is place in your your web hosting directory, we suggest in a directory at root called api, then the tabseleven nested inside the api directory. Like this /api/tabseleven. This allows a tidy grouping of our files in your API directory possibly along side other non related applications. The end result of this would be the URL in the browser example image below left.
What happens is the iPhone calls index.php and passes two string variables. The first called "unlock" is just a simple pass no pass test to keep out spiders or sneaky folks poking around your site. Not super safe but it helps. The second called "route" is the name of the secondary website file with your actual code that gets called into index.php. So in this example the route says tab1. This could be anything from tab1 to tab11. Each tab has a corresponding file in the api directory. In this example it would be tabseleven_tab1.php. The file names could be changed in the index file if you desire but the rout names can not as they are hardcoded in the iPhone App.
This is a very common technique for calling dynamic content. You will see similar URL strings on many of your favorite sites. The parameters in the URL call some function, action or other file and so on. The final image bottom right is yur web code in the browser on the lower left called into the iPhone when you click the Tab 1 button.
The next page will explain what each file does and how you can make them far more exciting then what I supplied!