Mozilla B2G

80
Mozilla B2G Dr.Haitham A. El-Ghareeb Twitter: @helghareeb

description

Boot to Gecko is the Latest Mozilla Contribution to the Larger Open Web Project. Why we needed B2G? What are the Pros and Cons? What are the Challenges and Opportunities? Interesting Session by Haitham El-Ghareeb

Transcript of Mozilla B2G

Page 1: Mozilla B2G

Mozilla B2G

Dr.Haitham A. El-Ghareeb

Twitter: @helghareeb

Page 2: Mozilla B2G

Mozi

lla is

D

iffere

nt

Page 3: Mozilla B2G

Product

s

Page 4: Mozilla B2G

Product

s

Page 5: Mozilla B2G

Product

s

Page 6: Mozilla B2G

Product

s

Page 7: Mozilla B2G

Product

s

Page 8: Mozilla B2G

Tech

nolo

gie

s

Gecko Necko NSPR NSS Rhino

SpiderMonkey Tamarian XPCOM XULRunner

Page 9: Mozilla B2G

Featu

red M

ozi

lla

base

d A

pplic

ati

ons

Page 10: Mozilla B2G

Challe

nges

Continue Desktop Improvement Mobile is Everywhere

Page 11: Mozilla B2G

Fire

fox

on

Win

dow

s

Page 12: Mozilla B2G

Fire

fox

on M

ac

Page 13: Mozilla B2G

Fire

fox

on L

inux

Page 14: Mozilla B2G

Aw

eso

me B

ar

Page 15: Mozilla B2G

Sw

itch

to T

ab

Page 16: Mozilla B2G

App T

abs

Page 17: Mozilla B2G

Tab G

roups

Page 18: Mozilla B2G

Syn

c

Page 19: Mozilla B2G

Add-o

ns

Manager

Page 20: Mozilla B2G

WebG

L

Page 21: Mozilla B2G

Inst

ant

Websi

te

ID

Page 22: Mozilla B2G

Priv

ate

Bro

wsi

ng

Page 23: Mozilla B2G

Add-o

ns

Build

er

Page 24: Mozilla B2G

Do N

ot

Track

Page 25: Mozilla B2G

Fire

fox

Inte

rface

O

verv

iew

Page 26: Mozilla B2G

Fire

fox

Syn

c O

verv

iew

Page 27: Mozilla B2G

Fire

fox

for

Mobile

This is it?

Page 28: Mozilla B2G

Add-o

ns

Manager

Page 29: Mozilla B2G

One T

ouch

B

ookm

ark

ing

Page 30: Mozilla B2G

Sta

rt P

age

Page 31: Mozilla B2G

Tabbed B

row

sing

Page 32: Mozilla B2G

Typin

g A

weso

me

Scr

een

Page 33: Mozilla B2G

Do N

ot

Track

Page 34: Mozilla B2G

Fire

fox

for

Andro

id t

able

ts

tabs

Page 35: Mozilla B2G

Fire

fox

for

Andro

id

table

ts U

I La

ndsc

ape

Page 36: Mozilla B2G

Not Enough!User Expectations are Not Limited!

Page 37: Mozilla B2G

Not Enough!Mozilla’s Mission AccomplishmentIn Progress!

Page 38: Mozilla B2G

Not Enough!Challenges around us Everywhere!

Page 39: Mozilla B2G

Eco

syst

em

Page 40: Mozilla B2G

Open W

eb

Definition for Open Web! Hah! No way! Lawyers Journalists Developers Users Kids …

Page 41: Mozilla B2G

Open W

eb…

For

Me

‘as

a D

eve

loper’

“It is the Web built using Open Source Technologies that Cope with Standards,

Where Users own their

data, have the right to

transfer and control them, and we can hide

ourselves from being

Tracked” - Haitham El-Ghareeb

Page 42: Mozilla B2G

Open W

eb A

pps

Video

Page 43: Mozilla B2G

Mozi

lla

Mark

etp

lace

Page 44: Mozilla B2G

B2G

Being just an Application is not enough anymore

We need to be the Framework for others

to build They have built many

products using our Technologies We continue doing so!

Page 45: Mozilla B2G

B2G

Boot to Gecko (B2G) is

an open source operating

system in development

by Mozilla Corporation

that aims to support

HTML5 apps written using

"open Web" technologies

rather than platform-

specific native APIs. It

initially targets Android-

compatible smartphones.

* From Wikipedia, the free encyclopedia

Page 46: Mozilla B2G

Announce

ment

On July 25, 2011, Dr.

Andreas Gal, Director of

Research at Mozilla Corporation, announced a

project to "pursue the goal

of building a complete,

standalone operating

system for the open web" in

order to "find the gaps that

keep web developers from

being able to build apps that

are --- in every way --- the

equals of native apps built

for the iPhone, Android, and

WP7.”

Page 47: Mozilla B2G

Work

Are

as

Web APIs Privilege Model Boot

Page 48: Mozilla B2G

Web A

PIs

expose device and OS

capabilities List of APIs Mozilla working on WebTelephony: Allow

placing and answering

phone calls as well as build

in-call UI. Vibration API: Control

device vibration for things

like haptic feedback in

games. Not intended to

solve things like vibration

for notification.

Page 49: Mozilla B2G

Web A

PIs

WebSMS: Send/receive

SMS messages as well

as manage messages

stored on device. Idle API: Get notifications

when user is idle. Screen Orientation: Get

notification when screen

orientation changes as

well as control which

screen orientation a page/app wants.

Page 50: Mozilla B2G

Web A

PIs

Settings API: Set system-

wide configurations that are

saved permanently on the

device. Resource Lock API: Prevent

resources from being turned

off, for example screen

dimming, WiFi turning off,

CPU going into sleep mode

etc. Power Management: Turn

on/off screen, cpu, device

power, etc. Listen and

inspect resource lock events.

Page 51: Mozilla B2G

Web A

PIs

Mobile Connection API: Expose

signal strength, operator, etc for

GSM and other mobile

connections. This does not cover

WiFi. TCP Socket API: Low-level TCP

socket API. Will also include SSL

support. GeoLocation API: Same API since

Firefox 3.5 UDP Datagram Socket API: Low-

level UDP API. Sensor API: Access to device

sensors such as accelerometer,

magnetic field (compass),

proximity, ambient light etc.

Page 52: Mozilla B2G

Web A

PIs

WiFi Information API: Enumerate

available WiFi networks, get signal

strength and name of currently

connected network, etc.

Device Storage API: Add/Read/Modify

files stored on a central location on

the device. For example the

"pictures" folder on modern desktop

platforms or the photo storage in

mobile devices. USB file-reading API: Add/Read/Modify

files stored on memory cards and

USB keys connected to the device.

Get notified when storage devices

are connected/disconnected. Will be

very similar to the Device Storage API

above with a few additional methods.

Page 53: Mozilla B2G

Web A

PIs

Contacts API: Add/Read/Modify the

device contacts address book.

Camera API: allow people using

the web platform to include

video/audio conferencing and

associated data as part of their

websites and applications.

Mouse Lock API: Lock access to

mouse and get access to

movement deltas rather than

coordinates. Open Web Apps: Install web apps

and manage installed webapps.

Also allows an installed webapp to

get payment information.

Everything needed to build a Opeb

WebApps app store.

Page 54: Mozilla B2G

Web A

PIs

WebNFC: Low level access to NFC

hardware. WebBluetooth: Low level access to

Bluetooth hardware.

Web USB: Low level access to USB

hardware. Network Information API: Get basic

information about current network

connectivity. Battery Status API: Information

about battery charge level and if

device is plugged in.

HTTP-cache API: Query what's

stored in the browsers http-cache.

Add/remove entries. Update

expiration time. Get data directly

from cache.

Page 55: Mozilla B2G

Web A

PIs

Alarm API: Schedule a

notification, or for an application

to be started, at a specific time.

Browser API: Enables

implementing a browser

completely in web technologies.

Time/Clock API: Set current time.

Timezone will go in the Settings

API. Calendar API: Add/Read/Modify

to the device calendar.

Intents/Activities/Actions: Have a

problem? This API will be able

solve it.

Page 56: Mozilla B2G

Web A

PIs

Device Capabilities API: Check if

the device has certain

capabilities, such as front-facing

camera, gps, etc. Keyboard/IME API: Enables

implementing virtual keyboards.

Spellcheck API: Enable

webpages to check if a piece of

text is correctly spelled as well

as get suggestions for

corrections. Background Services: Enable a

web application to run in the

background and perform tasks

like syncing or respond to

incoming messages.

Page 57: Mozilla B2G

Web A

PIs

Push Notifications API:

Allow the platform to

send notification messages to specific

applications. LogAPI: Allows to register the user activity on the phone.

Page 58: Mozilla B2G

Term

inolo

gy

Gaia

The user interface of b2g.

Everything drawn to screen

after b2g starts up is some part

of Gaia. Gaia implements a lock screen,

home screen, telephone dialer,

text-messaging application,

camera app, ... and many more.

Gaia is written entirely in HTML,

CSS, and JavaScript. Its only

interface to the underlying

operating system is through

Open Web APIs, which are

implemented by Gecko.

Page 59: Mozilla B2G

Term

inolo

gy

Geck

o

The "application runtime" of

b2g. Gecko implements the open

standards for HTML, CSS,

and JS and makes those

interfaces run well on all the

OSes that Gecko supports.

Gecko consists of, among

other things, a networking

stack, graphics stack, layout

engine, virtual machine (for

JS), and porting layers.

Page 60: Mozilla B2G

Term

inolo

gy

Gonk

The lower-level "operating

system" of b2g. Gonk consists of a linux kernel

and userspace hardware

abstraction layer (HAL).

The kernel and several

userspace libraries are

common open-source projects:

linux, libusb, bluez, etc.

Some other parts of the HAL

are shared with the android

project: GPS, camera, among

others. Gonk is an extremely simple

linux distribution.

Page 61: Mozilla B2G

Booti

ng

After turning on a b2g phone, execution

starts in the primary bootloader. From there,

the process of loading the main OS kernel

happens in the usual way: a succession of

higher-level bootloaders bootstrap the next

loader in the chain. At the end of the

process, execution is handed off to the linux

kernel. There's not a lot to say about the boot

process, but there are a few things worth

knowing The bootloaders usually show the first "splash

screen" seen during device boot, which usually

displays a vendor logo.

The bootloaders implement flashing an image

onto the device. Different devices use different

protocols. Most phones use the fastboot

protocol, but the Galaxy S II uses the "odin"

protocol. By the end of the bootstrapping process, the

modem image is usually loaded and running on

the modem processor. How this happens is

highly device-specific and possibly proprietary.

Page 62: Mozilla B2G

We will Skip Kernel Booting Process

They are very well documented elsewhere!

Page 63: Mozilla B2G

Geck

o:

DO

M A

PIs

"DOM interfaces", approximately, are how

web content communicates with Gecko. DOM interfaces are

defined in IDL, which

comprises both a foreign function interface (ffi) and object

model (OM) between

JavaScript and C++.

Page 64: Mozilla B2G

Open W

eb

Tech

nolo

gy

Sta

ck

Android kernel running on Qualcomm

ARM-based chipset hardware abstraction layer (HAL),

codenamed "Gonk" Mozilla's multi-platform Gecko ‘Web

browser engine’ to render HTML and

CSS and run JavaScript

platform-independent JavaScript APIs

for device features (telephony, SMS,

camera, Bluetooth, USB, NFC, etc.) of

varying degrees of standardization

platform-independent system

applications (lock screen, phone dialing

& phone messaging, a view of installed

applications, etc.) written in HTML5; the

user interface of these is codenamed

"Gaia” platform-independent HTML5 web

applications

Page 65: Mozilla B2G

Any

tim

e S

oon?

At Mobile World Congress 2012,

Mozilla and Telefónica announced

that the Spanish telecommunications provider

intended to deliver "open Web

devices" in 2012 based on HTML5

and these APIs. Mozilla also announced support for

the project from Adobe and

Qualcomm, and that Deutsche

Telekom’s Innovation Labs will join

the project. Mozilla demonstrated a "sneak

preview" of the software and apps

running on Samsung Galaxy S II

phones (completely replacing their

normal Android operating system).

Page 66: Mozilla B2G

Build

ing B

2G

For Galaxy SII For QUEMO Emulator

Page 67: Mozilla B2G
Page 68: Mozilla B2G
Page 69: Mozilla B2G
Page 70: Mozilla B2G

Reso

urc

es

Page 71: Mozilla B2G

Reso

urc

es

Page 72: Mozilla B2G
Page 73: Mozilla B2G
Page 74: Mozilla B2G
Page 75: Mozilla B2G
Page 76: Mozilla B2G
Page 77: Mozilla B2G
Page 78: Mozilla B2G

B2G

Web is the Platform…

for your Mobile!

Page 79: Mozilla B2G

B2G DemoGaia is Working!HTML, JS, CSS

Page 80: Mozilla B2G

Quest

ions

Thank You! Dr.Haitham El-Ghareeb