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

Preface

Mozilla publicly demonstrated the open source Firefox OS in February 2012. Firefox OS is an initiative by the open source company Mozilla to develop a mobile platform for smartphones as well as a host of other devices, such as tablets and televisions. The reason for rolling out this platform was to provide its users with an operating system that has an alternative that respects the user's privacy and puts security first. Firefox OS devices are a great choice for users who are transitioning from feature phones to smartphones or those who are concerned about privacy. Mozilla is best known for developing pieces of open source software, such as the Firefox web browser, and it doesn't answer its users rather than answering to stakeholders. The aim of Firefox OS is to run on devices that have limited hardware capabilities while still providing a unique and smooth user experience.

Mozilla has a huge community of developers and users, and they are always willing to help others on platforms such as GitHub and IRC (irc.mozilla.org). Firefox OS also has a great marketplace. It has grown over the years and offers great applications. In Firefox OS, HTML5 applications are first-class applications, and so any ordinary web application can be turned into a Firefox OS application in just a few steps. Even the user interface of Firefox OS, which is known as Gecko, has been built with the help of three components, namely HTML5, JavaScript, and CSS3. This makes developing applications easy for people who have already done web development.

What this book covers

Chapter 1, Introduction to Firefox OS, improves your understanding of Firefox OS by teaching its terminology, abstraction layer, and security model.

Chapter 2, Running Firefox OS Simulators with WebIDE, teaches you how to use WebIDE; install, uninstall, and create new applications; and use developer tools for applications running in WebIDE.

Chapter 3, Getting Your Hands Dirty – Firefox OS Apps, introduces the difference between packaged and hosted applications, security access levels of different Firefox OS applications, and developing application manifest files for apps.

Chapter 4, Diving Deeper with the Fox Creating Richer Apps, teaches you how to make hosted Firefox OS applications installable and offline. It then shows you how to apply web APIs to applications.

Chapter 5, Making Applications Visually Appealing – A Style Guide, takes you through the basic designing guidelines. These will help you make applications more user friendly. This chapter also tells you how to avoid some common UI blunders and apply the Gaia building blocks.

Chapter 6, Emerging as a Guru – Learning Web APIs, teaches web APIs, types of web APIs, web activities, and how to use them. This chapter also teaches you to implement all your acquired knowledge to build FoxFoto, a photo editing and sharing application.

Chapter 7, Testing Your Firefox OS Application, covers basic QA and unit testing, using Firefox developer tools for debugging, using the app validator to test applications, and using a spoof Firefox add-on for testing to improve the performance of a Firefox OS application.

Chapter 8, Firefox Marketplace – Setting up Your Bazaar, takes you through the Firefox Marketplace and shows you how to submit and update free and paid applications in the marketplace.

Chapter 9, Maintaining Your Firefox OS Application Code Professionally, takes you through setting up an account on GitHub, version controlling your Firefox OS application, and uploading the local repository to GitHub. It also teaches you how to set up Travis CI for your repository and host applications on RHCloud with the help of Git.

What you need for this book

You will need the following:

  • The latest version of Firefox available

  • Firefox OS Simulator (2.0)

  • An Android device running the Firefox web browser (optional)

  • A device running Firefox OS 2.0 (optional)

Who this book is for

This is a practical guide that uses hands-on examples to teach you how to create applications for Firefox OS and also how to port applications to the Firefox Marketplace. This book is intended for developers who want to build applications for Firefox OS. An understanding of HTML5, JavaScript, and CSS is required.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "I have replaced World with Firefox everywhere to make it Hello Firefox."

A block of code is set as follows:

  <script src="js/jquery-1.11.3.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <script src="js/clickr.js"></script>

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "When you click on it, you will see the Install Simulator option."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/9409OS.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.