Structuring php For HTML5 and Mobile Devices
I'm taking my first tentative steps into mobile apps and want to create one that accesses data on my apache/php/mysql server.
That means I need to step back and think carefully first about how to build the core code so that all of the functions work cross platform... that is, I need to redesign my website so that it's mobile device ready.
The site is a membership activity site that records member attendance at meetings, and also allows members to link to each other as friends. After I started writing it in the old way, I realised that when the mobile apps get built, I will need a different back end to service them. I'm therefore wondering how I structure things so that I have a single back end that services both the website and the mobile apps.
Do I use XML, AJAX or something else?
I know this is a vague, open ended question for which there are probably many answers, and if this is the wrong spot for the question, I apologise.
Also, if anyone can recomment an RAD environment that can help with all this, I'd be grateful.
Well what I do in an MVC pattern is to have multiple views and my dispatching controller will determine whether to load a view for a full page (header, nav, etc) or to load a view for a json response (to be used in AJAX) that way my models, core controllers, helpers, etc all function the same as they take and return the same data structure no matter what the response. It is the view being called that determines how to send it to the user.
I'd be glad to explain more if you're in an environment using MVC and have some more specific questions to how it works. Otherwise a generalized overview is the best I can do oft the top of my head.
A large part of supporting multiple devices is a matter of sending the right stylesheet. You can determine what kind of client you have from the request, and simply send back the requested page with an optimized stylesheet, and perhaps alternate version of graphics included.
Unless you are doing a lot of scripting on the client side, there is no reason it takes a lot of extra coding to support multiple browsers, multiple versions of browsers, multiple resolutions, and multiple devices.
So let me get this right...
I use the back end to serve up content according to the detected user agent. That makes sense to me, but to cut down on work, it seems to me that the most efficient solution is simply to have an app that runs in a browser shell (that is, a browser without any of the navigation).
And if I go that way, first, is there such a browser shell, and don't I then have a problem getting the various app stores to recognise that my site is a real app?
Going back and forth with a shell getting something from a web site actually how some apps work. However it is not a browser shell, it is a widget that you develop and it launches the browser native to the device. You would basically have to develop an version of that piece for each device/os you want to support.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)