Mobile Web Apps

Soldato
Joined
28 Apr 2011
Posts
14,819
Location
Barnet, London
So I'm learning Swift, one reason being I want to make a particular app for work. A friend told me Swift doesn't play well with external databases, so I checked how it could be done on Android and I would perhaps start there (connecting to a web based MySQL database) and realised it's not as straight forward as I'd hoped.

I then found how easy it was, using a manifest and some other code, that when you add you webpage to homescreen on both iOS and Android, it can run like it was an app, full screen and with a logo for your icon etc.

So, my new plan is to do it this way. I know I can reasonably easily code it in php and host it on my personal webspace. I can 'install' it on everyone's iPad (by that I mean 'save to Homescreen') and no-one would particularly know it wasn't actually an app.

I'm just wondering, is there anything I'm missing? Is there a better way to code a mobile app than plain old php? (Without too much learning new code)
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Is there a better way to code a mobile app than plain old php? (Without too much learning new code)

You're not really coding a mobile app, just a website which will be accessed by mobile devices. So you can use any lanugage you want that you'd normally use to build a website. It's going to be running on your webserver so there's no performance implications of different languages for these devices.

The main downside to using a website as an 'app' for a mobile device is that you'll be have more restricted access to the device. I'm dont know the exact details but I think things like SMS, dialler, contacts, etc are all non-accessible.
 
Soldato
Joined
18 Oct 2002
Posts
15,206
Location
The land of milk & beans
If you want to have remote data access in your native mobile app I'd suggest you write an API to expose the data (with the necessary security). If you already know PHP this should be quite straightforward. Then your app can make requests to this API and consume the data when needed.

It's a far better solution to keep the app native to the device than to have a website dressed up as a lobotomised app.
 
Soldato
OP
Joined
28 Apr 2011
Posts
14,819
Location
Barnet, London
Thanks for all the comments/suggestions.

The main downside to using a website as an 'app' for a mobile device is that you'll be have more restricted access to the device. I'm dont know the exact details but I think things like SMS, dialler, contacts, etc are all non-accessible.

Yeah, this is a comment I heard in a video. If you don't need anything from the actual phone, just do it in a mobile app/website. I don't. For this occasion it's a very simple 'app' kinda like controlling a football league table. Maybe at some point I'd like to integrate adding photo's, but I guess even then, worse case you take the photo, then load up the 'app' and attach from device I guess.

If you want to have remote data access in your native mobile app I'd suggest you write an API to expose the data (with the necessary security). If you already know PHP this should be quite straightforward. Then your app can make requests to this API and consume the data when needed.

I think I saw this as one of the ways to go, to stop your database being exposed by someone de-compiling your app and stealing the login details.

It's a far better solution to keep the app native to the device than to have a website dressed up as a lobotomised app.

Agreed. But as I barely know Swift at this point, and given the simplicity of what I'm after, I'll code it in php for now and then look to make a native version later perhaps.
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Agreed. But as I barely know Swift at this point, and given the simplicity of what I'm after, I'll code it in php for now and then look to make a native version later perhaps.

You'll also need to consider what happens if the device is offline. Presumably, if you need to connect to an external database, your app wouldn't work offline either but at least in that case you'd be able to show a nice error message rather than "Page cannot be displayed"
 
Back
Top Bottom