So far, most of this book has been about web technologies that can be used anywhere, from open websites to device-specific web apps. In this chapter, I’ll take a short detour to talk about the extra steps required to create applications—how you can adapt your site to make it available through an online application store, or even to make it installable on a device.
Before moving on to talk about the mechanics of creating applications, we should start by defining the core types:
Native apps are built using non–web technologies for specific platforms such as OS X, iOS, Windows, and Android.
Web apps use web platform languages and can include hosted websites or ones packaged inside compressed containers and installed on a device.
Hybrid apps use web platform technologies but are wrapped or packaged inside native containers.
In this chapter, I’ll look specifically at the latter two types, web apps and hybrid apps, and at how to make them available through some of the many application stores. But even that’s not as simple as it sounds: Many rival platforms and stores exist, each has a different development platform and submission process, and there isn’t a single standard way of defining an app (although there are a number of proposals to do so).
The good news is that many new app stores recognize the benefit of using web platform technologies to attract developers: huge time and money savings from not having to create an app multiple times in a different programming language for every platform. Many vendors, including Microsoft (Windows 8), Samsung (Smart TV), and Opera (Opera TV Store), use web platform technologies to power their apps. Although not quite a case of write once, run everywhere (you still have to consider each device’s unique APIs, and levels of browser support), developing a web app can be much more efficient than developing multi-platform native apps in both Java for Android and Objective-C for iOS.
In addition to discussing the different methods of building apps, I’ll also look at ways to make resources available offline and how to store them on a user’s device when a network connection isn’t available (something that’s still pretty common even in today’s wireless age). You accomplish this through the application cache (commonly known as AppCache), which, although quite powerful, is not without its pitfalls.