PHP App for iPad/Mobile?

Would it be possible to program a web app for an iPad/mobile device that would work without Internet access?

I know someone who wants me to build him an “app” for his business. The problem is that I do not know OOP or things like Objective C, Java, etc.

I fear that it could take me 6-12 months to learn how to build a mobile app, whereas maybe there is a way to do it using things that I already know (e.g. PHP, MySQL, HTML, CSS, etc.).

Suggestions?

As I understand apps, when you download the app, it comes with the HTML/CSS/JS etc to your phone. So as long as the app doesn’t need to connect to anything online, I think it would be fine.

You will want to use phonegap.

There is no way to use PHP offline, you can use it as a restful service when the client is online, but I don’t see Apple ever having PHP available offline.

1 Like

Let me make sure we understand each other…

When I build a website using PHP/HTML/CSS/etc, I can run it locally on my laptop with no Internet connection. All I need is a working local webserver like MAMP.

I was wondering if that same approach would work on say an iPad?

Here are the two issues…
1.) I think it would take me years to learn OOP, Objective C, etc to build a native app.
2.) I could learn much quicker to build a responsive website for an iPad, but if Internet connectivity is needed at all times, then I would be screwed.

The person who approached me about this wants something for his iPad that he can use in the field to take orders, calculate bids, etc. He could be some place where there is no wi-fi.

He thinks his only option is a native app, but I am hoping there is a way to leverage my existing knowledge of PHP/MySQL/HTML/CSS to build something that would work for him.

Without hosting the website remotely you would need the ios device to be running a local server compatible with a php interpreter. I don’t believe that is an easy thing to do. This is really a business problem that is more adequately suited to a native app than a website. For that reason if this were me I wouldn’t have any second thoughts of moving on as native app dev is much different than web dev.

The exception would be if the client could meet half way and use a Surface rather then an ios device. Surfuce has Windows 7 so xampp or a vm could be set-up locally with relative ease.

If you really want to consider a web site as an option than you would need to first determine if it is possible and the work involved in running a local php instance on a ios device. If you can’t figure that out there is no need in even considering this direction unless taking the surface compromise.

So maybe you can help me figure this out…

This person wants to use his iPad to be able to estimate contracts both in his office and out in the field. (I think it is more the former.)

He is convinced that native apps are superior to websites, even though I think that is a stretch.

I told him that with a RWD, he could use it as long as he has his smart phone with him to tether to or free wifi. He is convinced that is too difficult or unlikely to work. I say that unless you are in the middle of Utah in a canyon, relying on an Internet connection and a responsive website isn’t that unreasonable.

The solution would need a way for him to tap on keys on a screen, select different conditions/parameters of the job he is bidding on, and then have it spit out what the estimate would be.

I could write an website using PHP to do that, but it sounds like that may not work.

There has to be some way for me to offer a solution for his iPad without spending the next 5 years in college learning OOP, MVC, Objective C, Xcode, and so on?! :worried:

5 years is pretty much exaggerated. If you have some experience in programming in any language you should be able to build a simple app within a month by reading online tutorials. Recently, I managed to build my first Android app in about a month. The app has 4 simple screens, scans bar codes, verifies them, stores them in phone memory and sends them to a server when there is connection and also does GPS tracking. Not really that difficult - but I had some basic knowledge of Java. I’ve read that Objective C a a bit more difficult to start with but not by much.

Also, try searching for javascript iOS development and you may come up with interesting stuff like http://matt.might.net/articles/how-to-native-iphone-ipad-apps-in-javascript/ or https://www.nativescript.org/ !

Firstly, a “web app” should have Internet access to function at some point in time. What you can also have is local storage on the device, so that the application can still work, when Internet connectivity is missing. This is definitely possible.

If you know HTML5, CSS and Javascript, you can program fairly intricate web applications for mobile. The HTML5 standard also allows for the local storage I mentioned above. The other inherent advantage is you can program a single app, which will run on multiple platforms. cpradio’s phonegap suggestion is a good framework to start with (to avoid reinventing the wheel).

Up until now though, attempts to create very feature rich HTML5 mobile apps have resulted in moderately fair to poor results. HTML5 mobile apps usually end up reacting slower than native apps do, which simply kills the UX. For instance, Facebook made an attempt to go with an HTML5 hybrid for their mobile app and did an about face mid-way through and decided mobile would need to be native for their platform to work properly. Salesforce.com, on the other hand, has been plugging away at an HTML5 version of their mobile platform and it still doesn’t work like it should. They’ve been working on it a good part of 3 years too.

Basically, HTML5 mobile apps still just don’t do the “whole” trick, although, the gap is closing and none other than Apple itself is supporting this.

So, the overall answer is yes, if you know HTML5, CSS and Javascript, you can power your app with a PHP back end and go for it.

Other than that, you will need to learn Java(Android) or Swift (iOS) to program a native mobile app.

The other thing you might want to consider, is that there doesn’t appear to be any form of web server you can run locally on iOS (I’ve looked a number of times and can’t find one), though that may be different for Android. If you want to consider the MS Surface series devices, then you could definitely run something locally, either through a WAMP install, or using the built-in Hyper-V, inside which you could install a Linux-based LAMP server for example.

Just a reminder that you already have answers to many of these questions:

And where what would local storage be on an iPad?

But if there is no Internet access, then it sounds like things won’t work, right?

You can’t run a php website locally on an ios device.

The compromise is using a Surface.

If the business requirements call for an ios interface which can be used without a network connection than a native app should be the solution. Anything less is unprofessional.

However, native app development tends to be considerably higher in cost than a web site. So depending on the clients budget they may need to adjust their expectations to suite.

It is simply an interface through the browser. The data is stored by the browser and your app uses it though the interface. Read the article I linked to.

Yes, the app will work right, if you programmed the app to use local storage, when internet access is missing.

Scott

View 1:

View 2:

So who is right? :confused:

Both. The app should “work” offline, but it will be using what is in the browsers’ localStorage.

Think of it as a kind of cache, except it’s data stored by the app

IMHO this is likely best for “short connection outages” eg. going through a tunnel.
But I guess depending on what the app is doing and how important it is to get data “live” the usefulness will be more or less affected

As mentioned, the person needs a web app (or mobile app) to be able to take input and calculate a job estimate.

He seems convinced he needs a mobile app, but I’m really not sure where he would even need Internet access in most cases since I think he just wants an estimate he can give to a potential customer on the job site.

For instance, let’s say he is remodeling someone’s home, and needs to knock out one wall, build another wall, add outlets and plumbing for a mini bathroom. He could tap on some keys, add in some numbers (e.g. add 1 wall) and the app would spit out a remodeling estimate of $5,725.

I also think he is fearful that a website/mobile app would be slow.

As far as data, the program would need predefined estimation data (e.g. one wall = $500), and then I image it would be nice to store the data for each estimate he did (e.g. Jones new deck = $2,500, Wilson’s family addition = $8,200, Wang’s second story = $23,000).

Lastly, I am thinking it would be nice to get the customer estimations off of the iPad and transfer them to some client website/application where they could be stored for long-term, e-mailed out, printed, etc.

Now would using PhoneGap, HTML5, CSS and Javascript do such an app justice?

Or is that definitely one for a mobile app?

HTH.

AFAIK from this (2011 if I’m reading my roman numerals correctly)
http://diveintohtml5.info/storage.html
most browsers support localStorage up to 5 MB
* and apparently numerics eat bytes

So it would depend on how much the app needs.
eg. works without a cnx and can be updated
vs.
a lot of data transfer, need to be online

cnx?

lol

Sorry, that’s my eccentric “x” for “shun” i.e.
comnnection

How does my web app get loaded onto the iPad?

It would have to have an initial Internet connection, right?

What about after that?

Am I to infer from what was said above that after the web app is loaded, you would never need an Internet connection again?