Making a mobile version of your website with PHP
Creating a mobile version of your website is not a very hard task, but it requires a bit of work. Unlike a desktop browser (PC browser) a mobile browser still have limited resources and usually it has it’s unique way to interpret and renders the page.
When creating a mobile version of your website there is one thing you need to know before starting to develop:
- it will work for all phone types or only smartphones and newer types of devices?
Even with support of detection and translators to develop mobile sites, this decision actually might help you on how far you will want to go with the features of the website.
Now it is time to get your tools set.
First things first. Download WURFL witch is a mobile device detection system and register on their Community group. This is the must important tool that you will need for your mobile site. WURFL is a XML device system that will read a user agent string and based on that it will give a full feature and capabilities from the device.
The next step is to install a translator. This will help you on writing the code without worrying about if it is WML, CHTML, HTML 4, etc. Make’s things a ton easier. Currently WURFL works great with WALL (old WALL API) and WNG (the next generation of WALL – go with this one if you can).
With both of these you have all your libraries set and you should be ready to code.
The best and most advisable way to use this is to use WURFL to detect the device coming and if is a detected phone, then redirect to the mobile site, otherwise, normal site. Consider the rules fully and test all. In case of doubt, redirect to the normal site (there is a greater chance for the user agent being a browser from a desktop than a phone).
A couple of good useful notes:
- Create a domain.mobi or m.domain.com to support your mobile application
- Javascript is still very limited even smartphones
- size matters: rule of thumb 10 seconds for full page rendering
- devices such as iPad are considered mobile devices
- WURFL also is supported by Java
Good luck and have fun.
Filed under: , , , Tagged: , , , , ,
Be the first to comment