The iPhone has undoubtedly revolutionised mobile phone technology, providing users access to vast amounts information wherever they are and more importantly information about where they are.
One of the projects I have been working is BeerMap, a location aware iPhone application which shows you nearby pubs, how people have rated beer and lets your add to the database by uploading reviews and images.
My role in this project was to produce the web service to manage all of the information, and I thought it may be useful to give a summary of the technologies used.
PHP & The Zend Framework
The Zend Framework is an extensive PHP library providing the MVC approach to code structure which is also recommended for iPhone development.
I also heavily extended the Zend_Controller_Action class to incorporate authentication and context switching depending on the response type needed.
MySQL Stored Procedures
All our data is stored in a MySQL database, so it was logical to also create a mechanism within the database to calculate distances depending on longitude and latitude. This calculation can be relatively expensive so I am looking a ways to further optimise this process, however it appears to be working relatively efficiently at the moment.
Web services generally will provide a response in XML or JSON, however using these response formats would require additional libraries to be included within the iPhone app, increasing its size and complexity. However, by generating a Plist response, the iPhone can read this without any complex parsing or processing.
For this we modified a version of the CFPropertyList library and added a better mechanism for guessing variable types which I hope will be integrated into the original library at some point soon.
Above is just a very brief summary of the technologies used, however please contact me for more information and take a look at the websites below:
Photo Credit: Will Ockenden