At kc web design Kent we create a lot of web apps – some for ourselves and some for clients. Most web apps are made to work online but sometimes, we need to create a web app that works offline, say on a mobile device when a connection is lost. How can a web app work with no internet connection you may ask. Well, there are a few things you can do to make sure your web app works with no connection. On a current web app project at kc web design kent we did just that.

Firstly, make sure that your web app really needs to work offline. There’s no need to work towards an offline web app if you don’t need to. If you do need it to work offline then make sure you know that before you start as this decision will dictate the code base you use. For an offline app you’ll really want to code things in a client side language such as Jquery with a minimal amount of PHP or server side coding. If you do need some PHP to communicate with a server then wrap it in Ajax calls so that you can check for a connection before you do any communicating with the server. There are a few scripts out there that help with this and we’ve used a very good one from Tom Riley.

Using Jquery or other client side languages means you can get all the main bulk of the app coded and working without any server interaction. For the few things that may need a server connection you can check for that connection and then alert the user that those features won’t be available until a connection is available again. Another way to make apps work offline is to utilise HTML5 local storage and save all form fields and data locally in the browser until a connection is available again. We’ve played around a lot with local storage at kc web design kent on a recent web app design project and be warned, it doesn’t always behave as you might think.

There are also other methods of making sure that your web app works offline and we’ll go into more detail on those in another post.

If you have a web app project then give kc web design kent a call. We’re experts in all types of web apps, iPhone apps and business websites.