Book Image

Learning Firefox OS Application Development

By : Tanay Pant
Book Image

Learning Firefox OS Application Development

By: Tanay Pant

Overview of this book

With broad compatibility, the latest in web technologies, and powerful development tools, Firefox is a great choice for both web developers and end users. Firefox OS’s promotion of HTML5 as a first class citizen opens up the walled gardens of mobile application development for web developers. It is because of this initiative that no special SDKs are required to develop for Firefox OS. This book will help you excel in the art of developing applications for Firefox OS. It sequentially covers knowledge building, skills acquisition, and practical applications. Starting with an introduction to Firefox OS, usage of WebIDE, and then the application structure, this book introduces applications of increasing complexity with each chapter. An application that measures your tapping speed, a geolocation tagging application, and a photo editing and sharing application are the three applications that will be built from scratch. You will learn about topics such as the difference between various types of Firefox OS applications, application manifest files, offline apps, and designing principles for applications. You will also learn to test and submit the applications to the marketplace and finally maintain the repository of the Firefox OS application. By the end, you will be able to develop beautifully designed, fully-fledged, and rigorously tested Firefox OS applications and also share them at the Firefox OS Marketplace.
Table of Contents (17 chapters)
Learning Firefox OS Application Development
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making hosted apps work offline with AppCache


Wouldn't it be great if we didn't face network problems like the one we faced in the previous chapter? Then, for simple applications that do not use a data connection or privileged Web APIs, we could simply use hosted variants for distribution of without going through the Firefox Marketplace. There's a solution for this problem called AppCache. Using AppCache, we can make our applications work offline. The full form of AppCache is Application Cache and with the help of this, after the first time the application is loaded, no internet connection is required for the working of the application.

Application Cache is a component of HTML5 and is really very easy to implement. Implementing AppCache is as simple as including a manifest.appcache file in the root of your application. In the manifest file, you have to include the resources that you want the browser, or in our case the operating system, to cache. You can cache static resources, such as stylesheets...