www.webdeveloper.com
Results 1 to 5 of 5

Thread: Structuring php For HTML5 and Mobile Devices

  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    700

    Structuring php For HTML5 and Mobile Devices

    Hi All,

    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.

    Cheers
    CTB

  2. #2
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    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.

  3. #3
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    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.

  4. #4
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    700
    Thanks,

    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).

    The user would download an app that's just a browser shell with an embedded line of code directing that browser to a web address, and an icon/logo to make it unique. That way, it's the CSS that does the heavy lifting rather than a whole bunch of javascript data exchange functions on the device. Am I right or am I missing something?

    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?

  5. #5
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles