/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@DerokorianOct 30.2012 — 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.
Copy linkTweet thisAlerts:
@COBOLdinosaurOct 30.2012 — 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.
Copy linkTweet thisAlerts:
@chestertbauthorOct 30.2012 — 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?
Copy linkTweet thisAlerts:
@COBOLdinosaurOct 31.2012 — 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.
×

Success!

Help @chestertb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...