Thursday, 19 December 2013

INTRODUCTION

Firefox OS is a new mobile operating system developed by Mozilla, which lets users install and run open web applications developed using HTML, CSS, and JavaScript. It was named Boot 2 Gecko (B2G) originally when the project was announced on July 25, 2011 and changed to Firefox OS on July 2012.



Firefox OS is currently under heavy development; we are constantly working on ways to make it easier for you to use the different developer features of Firefox OS, use and customize Gaia (the default set of apps), build your own apps that will install and run on Firefox OS, build the entire Firefox OS stack, and flash a phone with a build of Firefox OS.

The Mission of Mozilla Corporation

The mission of Mozilla Corporation is not to make profit but build a brighter future for web. They are aiming at getting the best out of the web. They want the users to participate and help in developing the Firefox OS. They want to bring their community to ours. Pursue the goal of building a complete standalone os for the open web. To find gaps that keep web developer from being to build apps that are in every way the equals of native app built for iOS, Android, Windows


Specifications
  • Firefox OS is open source i.e. its code is available for modification for users.
  • Coding for Firefox OS requires HTML5 and JavaScript only.
  • It gives full access to device’s features like hardware and program files.
  • It works on a Linux based kernel.
  • It uses Mozilla’s Gecko technology based engine.
  • Most of the apps are web pages.

Pros
  • Ready for inventions as it is open source.
  • Do not bother about internal memory.
  • Dynamic app search.
  • Tasks can be performed online in web app of offline through web cache
  • Packaged apps are also available

Cons
  • It is still in developing stage
  • Unlike android it will target web app developers mostly
  • To access all feature, one needs to have knowledge about all Linux commands
  • It is just a platform to develop web apps for smartphones to perform a task
  • Web is the backbone so needs internet connectivity 


HARDWARE REQUIREMENTS

Most recent ARM-based mobile devices are powerful enough to support porting Firefox OS. This section covers the basic hardware requirements as well as the recommended hardware features

The table 2.1 describes minimum and recommended hardware requirements for the Firefox OS  
Component
Minimum
Recommended
CPU
ARMv6
Cortex A5 class or better
ARMv7a with NEON
GPU
Adreno 200 class or better
Connectivity
Wi-Fi
3G
Sensors
Accelerometer
Proximity
Ambient light
A-GPS

For a good user experience, it's a good idea to choose a device that offers a uniform colour profile (implemented by the graphics device driver) and headphone support for muting and unmuting and for stopping and playing media. These features are common among modern smartphone.For a good user experience, it's a good idea to choose a device that offers a uniform colour profile (implemented by the graphics device driver) and headphone support for muting and unmuting and for stopping and playing media. These features are common among modern smartphone.
Buttons and Controls
A typical Firefox OS device needs a small number of physical hardware buttons:
Home button

This button is generally centred below the screen. Pressing it will return you to the app launcher. Holding it down opens the card switching view; swiping up on an app in that view will terminate it.

Volume control rocker

Along the left side is the volume rocker; pressing the top half of the rocker increases the audio volume and pressing the bottom half decreases the volume.

Power button

The power button is at the top right corner of the device

Wednesday, 18 December 2013

ARCHITECTURE AND PLATFORM GUIDE

Core Technologies

Gaia - the user interface application for Firefox OS devices; this is a Web application running atop the Firefox OS software stack.

Gonk - the operating system layer underneath Gaia. This consists of a Linux kernel and a hardware abstraction layer to which Gecko communicates.

Gecko - is the layer of Firefox OS that provides the same open web standards implementation used by Firefox and Thunderbird, as well as many other applications

platforms



GAIA

Gaia is the user interface level of Firefox OS. Everything that appears on the screen after Firefox OS starts up is drawn by Gaia, including the lock screen, home screen, dialler, and other applications. Gaia is written entirely in HTML, CSS, and JavaScript. Its only interface to the underlying operating system and hardware is through standard Web APIs, which are implemented by Gecko.
Because of this design, Gaia can not only be run on Firefox OS devices, but on other operating systems and in other web browsers (albeit with potentially degraded functionality depending on the capabilities of the browser).
Third party applications onto the device installed alongside Gaia can be launched by Gaia.
Components of Gaia
Gaia consists of mainly Apps and JS libraries. It is also called the application layer. Following are the types of apps:
  • Core-certified apps
  • System apps
  • Trusted package apps
  • Hosted apps

The Gaia lock screen

By default, the lock screen is enabled, and the default PIN to unlock the device is "0000". This most likely will change over time as this feature is fleshed out.

lock screen and home screen


The default Gaia interface


The default interface in Gaia is similar to what you see on most typical smartphone, as seen here.
This image is obviously of a pre-release version of the operating system, with placeholder icons (and some test applications). The status bar at the top indicates the network on which the phone is operating (or "No SIM card" for a device without a network), the network strength, Wi-Fi signal strength, battery level, and current time.
The middle area of the display shows icons for the applications; swiping left and right pages through screens of icons.
At the bottom of the screen is a dock with room for up to seven of your most commonly used applications. You can drag and drop apps to the dock from the middle area.

GONK

Gonk is the lower level operating system of the Firefox OS platform, consisting of a Linux kernel and userspace hardware abstraction layer (HAL). The kernel and several of the user space libraries are common open-source projects: Linux, libusb, bluez, and so forth. Some of the other parts of the HAL are shared with the Android project: GPS, camera, and others. You could say that Gonk is a very simple Linux distribution. Gonk is a porting target of Gecko; that is, there's a port of Gecko to Gonk, just like there's a port of Gecko to OS X, Windows, and Android. Since the Firefox OS project has full control over Gonk, we can expose interfaces to Gecko that can't be exposed on other operating systems. For example, Gecko has direct access to the full telephony stack and display frame buffer on Gonk, but doesn't have this access on any other operating system.
Components of Gonk
Gonk consists of following :
  • Linux Kernel
  • Hardware Abstraction Layer (HAL)
  • Libraries : OSS (Open Source Software) and OEM (Original Equipment Manufacturer) libraries
  • Modem firmware
The Linux Kernel

The Linux kernel(s) used by Gonk is very similar to the upstream Linux from which it's derived. There are a few changes made by the Android Open Source Project that have not yet been up streamed. In addition, vendors sometimes modify the kernel and upstream those changes on their own schedule. In general, though, the Linux kernel is close to stock.
The start-up process for Linux is well-documented elsewhere on the Internet, so this article won't cover that. At the end of the process, a user space init process is launched, as it is in most UNIX-like operating systems. At this point in execution, the only mounted "disk" is a RAM disk. The RAM disk is built during the Firefox OS build process, and contains critical utilities, such as init, as well as other start-up scripts and loadable kernel modules.
Once the init process is launched, the Linux kernel handles system calls from user space, and interrupts and the like from hardware devices.
The init process
The init process in Gonk handles mounting the required file systems and spawns system services. After that, it stays around to serve as a process manager. This is quite similar to init on other UNIX-like operating systems. It interprets scripts (that is, the init*.rc files) that consist of commands describing what should be done to start various services. The Firefox OS init.rc is typically the stock Android init.rc for that device patched to include the things required to kick-start Firefox OS, and varies from device to device.

user-space architecture

The user space architecture:
b2g
The b2g process may, in turn, spawn a number of low-rights content processes. These processes are where web applications and other web content are loaded. These processes communicate with the main Gecko server process through IPDL, a message-passing system
rild
The rild process is the interface to the modem processor. rild is the daemon that implements the Radio Interface Layer (RIL). It's a proprietary piece of code that's implemented by the hardware vendor to talk to their modem hardware. rild makes it possible for client code to connect to a UNIX-domain socket to which it binds.
rilproxy
In Firefox OS, the rild client is the rilproxy process. This acts as a dumb forwarding proxy between rild and b2g. This proxy is needed as an implementation detail; suffice it to say, it is indeed necessary. The rilproxy code can be found on GitHub.
mediaserver
The mediaserver process controls audio and video playback. Gecko talks to it through an Android Remote Procedure Call (RPC) mechanism. Some of the media that Gecko can play (OGG Vorbis audio, OGG Theora video, and WebM video) are decoded by Gecko and sent directly to the mediaserver process. Other media files are decoded by libstagefright, which is capable of accessing proprietary codecs and hardware encoders.
netd
The netd process is used to configure network interfaces.
dbus-daemon
The dbus-daemon implements D-Bus, a message bus system that Firefox OS uses for Bluetooth communication.
wpa_supplicant
The wpa_supplicant process is the standard UNIX-style daemon that handles connectivity with Wi-Fi access points.

GECKO

Gecko is the name of the layout engine developed by the Mozilla Project. It was originally named NGLayout.
Gecko's function is to read web content, such as HTML, CSS, XUL, JavaScript, and render it on user's screen or print it. In XUL-based applications Gecko is used to render the application's user interface as well.
Gecko is used in many applications, including a few browsers, such as Firefox, SeaMonkey, etc.
Gecko provides the foundation needed to display content on the screen, including a layout engine and a complementary set of browser components. However, Gecko does not package all of these components alongside other interface modules in a coherent, use friendly application (including menus, toolbars, etc.), such as Firefox.

Components of Gecko

Gecko consists of :
  • Web APIs
  • Security
  • Gecko runtime – Graphics stack, layout engine, virtual machine, porting layers 

Three Layers of Firefox OS







SECURITY

 The Firefox OS platform uses a multi-layered security model that is designed to mitigate exploitation risks at every level. Front-line countermeasures are combined with a defence-in-depth strategy that provides comprehensive protection against threats. Gecko is the gatekeeper that enforces security policies designed to protect the mobile device from misuse. The Gecko layer acts as the intermediary between web apps (at the Gaia layer) and the phone. Gonk delivers features of the underlying mobile phone hardware directly to the Gecko layer. Web apps access mobile phone functionality only through the Web APIs, and only if Gecko allows the access request – there is no direct access, no “back door” into the phone. Gecko enforces permissions and prevents access to unauthorized requests.

Security measures are used throughout the technology stack. File system privileges are enforced by Linux's access control lists (ACLs). System apps are installed on a volume that is read-only (except during updates, when it is temporarily read-write). Only areas containing user content may be read-write. Various components within the device hardware have built-in protections that are implemented by default as standard industry practice. Chipset manufacturers, for example, employ hardening techniques to reduce vulnerabilities. The core platform (Gecko and Gonk) is hardened to strengthen its defence against potential threats, and hardening features of the compiler are used where applicable. For further details see Runtime security.

Secure System Updates

A built-in update service – which may be provided by the OEM – on the mobile phone periodically checks for system updates. Once a system package becomes available and is detected by the update service, the user is prompted to confirm installation. Before updates are installed on the mobile device, the device storage is checked for sufficient space to apply the update, and the distribution is verified for:
  •   update origin (verify the source location protocol:domain:port of the system update and manifest)
  •  file integrity (SHA-256 hash check)
  • code signature (certificate check against a trusted root
Types of Apps
Type
Trust Level
Description
Certified
Highly Trusted
System apps that have been approved by the Operator or OEM (due to risk of device corruption or risk to critical functionality). System apps and services only; not intended for third-party applications.
This designation is reserved for just a small number of critical applications. Examples: SMS, Bluetooth, camera, system clock, telephony, and the default dialler (to ensure that emergency services are always accessible).
Privileged
Trusted
Third-party apps that have been reviewed, approved, and digitally signed by an authorized Marketplace.
Web (everything else)
Untrusted
Regular web content. Includes both installed apps (stored the mobile phone) and hosted apps (stored remotely, with only an app manifest stored on the mobile phone). The manifest for hosted apps can be obtained through a Marketplace.
                 




INTRODUCTION TO OPEN WEB APPS

Open Web Apps are essentially no different than standard websites or Web pages. They are built using standard open Web technologies — HTML, CSS, JavaScript, etc. — and can be accessed using a Web browser. The main differences lie in their ability to be installed on a device and work offline, and access to advanced APIs that allow interaction with device features such as the camera, address book, and other such things. In addition, they are built on open technologies as much as is possible. 
Advantages of Open Web Apps

Local installation and offline storage:  Open Web Apps can be installed on the device, and leverage APIs such as local storage and IndexedDB to provide local data storage capabilities. In addition, open Web technologies tend to have a much smaller footprint than native apps and can generally be updated atomically rather than having to install a complete new package each time there's an update. (An exception to this is packages apps, which require a whole new package when updating.) Apps are therefore less dependent on an always-on Web connection and more useful when networks are patchy.

      Hardware access: The metadata provided with Open Web Apps can be used to grant the application permission to privileged APIs that enable usage of device hardware features, something the Web platform has not traditionally enjoyed.

Breaking the walled gardens: The norm for mobile platforms tends to be walled gardens written with proprietary technologies, so apps are locked inside their platforms. And smartphone tend to be expensive, and require credit cards for app purchases. Open Web Apps tend to be able to run on much cheaper hardware, especially in the case of Firefox OS devices where you've literally just got Firefox running on top of a lightweight Linux kernel. And they are written using open Web technologies, which is the most distributed platform around. In addition, Firefox OS devices feature payment systems where you can simply prepay for apps, or add the cost to your phone bill.

Open Web App stores: Following on from the previous point, you can choose to host your apps in an existing marketplace (such as the Firefox Marketplace), or host them somewhere else entirely. It's up to you. Mozilla aims to put the developer back in control of every aspect of the app experience — from easy development to distribution to direct customer relationship management. And the apps can be searched for just like any other Web-based experience.

The Web is platform
An open web app as it exists as installed on a platform like Firefox OS is not a bookmark — it’s a proper part of the system. Open Web Apps hold that great promise. They are an opportunity that we should not miss; otherwise the Web might become fragmented once more. With this in mind it should be made clear that Open Web Apps (OWA in short) are intended to be standardized and to become part of "the Web". If successful, OWA should eventually work on all browsers, operating systems and devices.
At Mozilla we are working hard to create this apps platform that is backed entirely by the open Web. It’s not intended to be a “Mozilla platform” or a “Firefox platform”. The Web is the platform. We’re creating a set of open APIs and implementations to show how portable apps can exist on the Web without vendor lock-in. Other groups like Face book and Google Chrome are also working on apps platforms backed by the Web. Face book apps are meant to hook into Face book and Chrome apps are designed for Chrome OS devices and Google servers. Chrome apps are the most similar to Open Web Apps. We continue to collaborate with the Google Chrome team as app standards evolve and we definitely share a lot of the same vision. There is tremendous potential for all Web based app platforms to converge and we invite all vendors to help us build the right Open Web App APIs.
Even though currently you must have a Mozilla Firefox-based engine ("Web runtime") to use Open Web Apps, it is not intended that this always will be the case. Many parts of the Open Web Apps project are still being worked out and it isn't possible to implement everything in all browsers at once. Although many parts of Open Web Apps are already standardized, many other parts are still in flux. It is intended and hoped that Open Web Apps will be a standard capability that is available in all major browsers.
App Tools
App validator
Is your app ready for the Firefox Marketplace? The App validator will check your manifest and show you any errors it may have, or warnings you should consider.
Firefox OS simulator
Installing and using the Firefox OS Simulator is the easiest way to get up and running with your app. After installed the simulator is accessible via the Tools -> Web Developer -> Firefox OS Simulator menu. The simulator launches with a JavaScript console so that you may debug your application from within the simulator!
App manager
The new kid on the block with regards to testing tools is called the App Manager. This tool allows you to connect desktop Firefox to a compatible device via USB (or a Firefox OS simulator), push apps straight to the device, validate apps, and debug them as they run on the device.
Firefox developer tools
Firefox now ships with a default set of developer tools built from the ground up to ensure a great development experience that is both snappy and efficient. To find out more about how these tools work, and see a detailed list of what else Mozilla has to offer, head on over to our Tools zone.
App publishing options
The Firefox Marketplace is our own dedicated app store for distributing free and paid apps. Submitting an app to the Firefox Marketplace is a simple process, involving uploading the app itself plus surrounding information, and waiting for it to go through our thorough review process to make sure it is high quality and not malicious. Submitting to the Firefox Marketplace also confers other advantages such as increased publicity, no need to implement special APIs on your own web site, and the possibility of publishing paid apps more easily. You can submit both hosted apps and packaged apps to the Firefox Marketplace.
Hosted apps
A hosted app is basically an app hosted on a web server just like a regular web page. If you want to let people install a hosted app straight from the site, you must implement some JavaScript code on your Web site to manage installing and updating your app into users' browsers, and make sure your app code includes a valid manifest file. Please see our write-ups of manifest files and Install API functionality for how simple these steps are to implement.
Where you host the app is really up to you, but the two options listed below are probably the most common and easiest
GitHub - If the Web app is purely static (HTML/CSS/JavaScript, but no server-side processing), GitHub Pages is a solid hosting option. It will serve your manifest with the correct MIME type if you give it a .webapp extension.
Generic hosting solutions - For dynamic websites, use a generic hosting option (like a Web server you may already own or have access to) with the right capabilities or a hosting provider specifically tailored to the needs of your app, like Heroku or Google App Engine.
Packaged apps
A packaged app is an Open Web App that has all of its resources (HTML, CSS, JavaScript, app manifest and so on) contained in a zip file, instead of having its resources on a Web server. A packaged app is simply a zip file with the app manifest in its root directory. The manifest must be named manifest.webapp. One difference from a hosted app is that a packaged app must specify a launch_path in the manifest, whereas it's an optional manifest field for a hosted app.
Self publishing apps
You can also choose to self-publish apps. For hosted apps, this just involves putting them up on web hosting, as detailed above. You can self-publish a packaged app by hosting it on a server along with a mini-manifest in the same directory that identifies the app and is used in the install process. 

THE LAUNCH


Firefox OS based devices namely, the ZTE Open and Alcatel OneTouch Fire, have hit store shelves in Spain and other countries like Poland, Colombia, Venezuela and Brazil for approximately Rs 5000. While these phones are very basic with 3.5 inch display, 1 GHz processor and 256 MB RAM. These handsets also come with 3G, WiFi, Bluetooth, and GPS with A-GPS support as well. There is a 3.15 megapixel primary camera, 512 MB internal storage with micro SD card slot and 2 GB card in the package.
The significance of the launch lies with the fact that Firefox OS is the only challenger to Android in entry level segment to reach the market. While Apple iOS and Microsoft's Windows Phone 8 both compete with Android but only in the mid to high segment. Android has so far had unchallenged reign in entry level smartphone and tablet segment, which is contributing biggest chunk for Android based smartphones.
Firefox OS is made by Mozilla and supports HTML5 based applications, which means that it will be very easy for developers to develop apps for these phones. Also the OS is very light and therefore will not put a lot of drain on phones resources and therefore it is expected that phone like ZTE Open will still run smooth despite having very basic specification. So why is it that Mozilla chose to ignore India which is by far the largest market for entry level smartphones ? Well it has to do more with logistics and distribution issue than anything else, Mozilla has gone for operator driven sales model wherein operators sell the phones.
In India, except a few operators many sell the phones as they don't have that channel available in India. However other big reason is the predominance of Indian players in the handset space who are deeply into Android ecosystem and for them to change to offer Firefox OS based devices will take a lot of convincing from Mozilla.
But a big market like India can't be ignored and therefore Sony seems to be preparing to launch Firefox version of its Xperia E in India. As we reported earlier, it is busy testing the phone and is expected to soon release in India.

By doing so Sony will save a lot of money as it won't need to develop new hardware; it's just porting that needs to be done. We do not expect Sony to price the phone at Rs 5,000 level rather the Firefox OS based version will be priced at same level as Xperia E Android version. Both Firefox and Android are free operating systems so it is only the hardware and development cost which will determine the price. We do not know the timelines of the launch, but we hope that it is sooner than later.