SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
APPS FOR FIREFOX OS
What are they, and how can I build one?

Anant Narayanan
Mozilla

August 2012
The Web is the Platform
Apps on FirefoxOS are built exclusively using web technologies
The very same stack used to build (modern) web pages:
HTML(5)
CSS3
JavaScript
An app is simply a collection of web pages designed to look and
feel like one
Why the Web?
A single code-base for all platforms
Based on Open Standards
Participatory in nature, can get started very quickly & easily
No lock-in
Apps are not websites
A common mistake is to repurpose an existing website into an
app without any modification
Mobile devices operate in a unique environment that must be
take into account while designing an app
What are some common pitfalls?
3 big gotchas: Layout, Offline, Transitions
Layout
Mobile screens are not only smaller than desktops, but are also
subject to orientation changes by users
Readability is very important
Luckily, CSS3 has everything you need to serve different layouts
based on screen size!
Advanced templates like bootstrap will even gracefully switch
between different layouts (responsive design)
Offline
Unfortunately, you don’t get this for free
Special considerations must be made while developing the app
An arsenal of tools at your disposal to help you ranging from
localStorage to AppCache
Always check for errors!
XHRs are most susceptible
Launch & Transitions
The white page interstitial is acceptable when browsing the web,
but not when using an App
Special care should be taken to have a very smooth launch
experience by using a very small, quick to load page
Subsequent page loads should be handled with CSS3 transforms
to move in preloaded content to avoid the white screen effect
Fortunately, this is not hard to do in many JS frameworks
WebAPIs
Every piece of hardware in a phone running FirefoxOS is
accessible to JavaScript!

Geolocation, Camera, Accelerometer, Compass, TCP Sockets,
SMS, Phone, Vibration... what do you need as a developer?
Enough Talk, Show me the Code!
You can get started very quickly in just two steps:
Create an app template in Mortar
Deploy the app to a B2G Desktop build
Iterating on your app is easy with Firefox Nightly
Mortar
$ git clone https://github.com/mozilla/mortar.git
$ cd mortar && npm install
$ ./bin/build app-stub demo-app

B2G Desktop Build
$
$
$
$

wget http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/...
git clone https://github.com/mozilla-b2g/gaia
make -C gaia profile
/path/to/b2g -p gaia/profile
Identity with Persona
navigator.id.watch(callback);
navigator.id.request();

Integrating a login system is super easy!
Easy Payments
Support for paid apps...
mozmarket.receipts.verify(...);

... and in-app payments ...
let req = mozmarket.buy(...);
req.sign(jwt);
Firefox Nightly
All your standard developer tools, now in-built!
Responsive layout preview
DOM Tree Inspector (also available in 3D!)
Finishing Touches
Packaging
Only needed for certain types of apps
Submit to the Marketplace!
Happy Hacking!
HTML / CSS / JS
+
Mortar / Bootstrap
+
Firefox Nightly / B2G Desktop Build
=
An amazing app!

anant@mozilla.com

Más contenido relacionado

Más de Anant Narayanan

Más de Anant Narayanan (18)

WebRTC: User Security & Privacy
WebRTC: User Security & PrivacyWebRTC: User Security & Privacy
WebRTC: User Security & Privacy
 
Firefox Architecture Overview
Firefox Architecture OverviewFirefox Architecture Overview
Firefox Architecture Overview
 
πP
πPπP
πP
 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-Ons
 
An Overview of Distributed Debugging
An Overview of Distributed DebuggingAn Overview of Distributed Debugging
An Overview of Distributed Debugging
 
A Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionA Brief Incursion into Botnet Detection
A Brief Incursion into Botnet Detection
 
Mozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the BrowserMozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the Browser
 
about:labs
about:labsabout:labs
about:labs
 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An Overview
 
Innovating with Mozilla Labs
Innovating with Mozilla LabsInnovating with Mozilla Labs
Innovating with Mozilla Labs
 
Glendix: The Why and the How
Glendix: The Why and the HowGlendix: The Why and the How
Glendix: The Why and the How
 
Mozilla Prism
Mozilla PrismMozilla Prism
Mozilla Prism
 
Making Gentoo Tick
Making Gentoo TickMaking Gentoo Tick
Making Gentoo Tick
 
Introduction to XPConnect
Introduction to XPConnectIntroduction to XPConnect
Introduction to XPConnect
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell Labs
 
Introducing Plan9 from Bell Labs
Introducing Plan9 from Bell LabsIntroducing Plan9 from Bell Labs
Introducing Plan9 from Bell Labs
 
Extending Python with ctypes
Extending Python with ctypesExtending Python with ctypes
Extending Python with ctypes
 
Building Web Applications with MochiKit and Dojo
Building Web Applications with MochiKit and DojoBuilding Web Applications with MochiKit and Dojo
Building Web Applications with MochiKit and Dojo
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Apps for FirefoxOS

  • 1. APPS FOR FIREFOX OS What are they, and how can I build one? Anant Narayanan Mozilla August 2012
  • 2. The Web is the Platform Apps on FirefoxOS are built exclusively using web technologies The very same stack used to build (modern) web pages: HTML(5) CSS3 JavaScript An app is simply a collection of web pages designed to look and feel like one
  • 3. Why the Web? A single code-base for all platforms Based on Open Standards Participatory in nature, can get started very quickly & easily No lock-in
  • 4. Apps are not websites A common mistake is to repurpose an existing website into an app without any modification Mobile devices operate in a unique environment that must be take into account while designing an app What are some common pitfalls? 3 big gotchas: Layout, Offline, Transitions
  • 5. Layout Mobile screens are not only smaller than desktops, but are also subject to orientation changes by users Readability is very important Luckily, CSS3 has everything you need to serve different layouts based on screen size! Advanced templates like bootstrap will even gracefully switch between different layouts (responsive design)
  • 6. Offline Unfortunately, you don’t get this for free Special considerations must be made while developing the app An arsenal of tools at your disposal to help you ranging from localStorage to AppCache Always check for errors! XHRs are most susceptible
  • 7. Launch & Transitions The white page interstitial is acceptable when browsing the web, but not when using an App Special care should be taken to have a very smooth launch experience by using a very small, quick to load page Subsequent page loads should be handled with CSS3 transforms to move in preloaded content to avoid the white screen effect Fortunately, this is not hard to do in many JS frameworks
  • 8. WebAPIs Every piece of hardware in a phone running FirefoxOS is accessible to JavaScript! Geolocation, Camera, Accelerometer, Compass, TCP Sockets, SMS, Phone, Vibration... what do you need as a developer?
  • 9. Enough Talk, Show me the Code! You can get started very quickly in just two steps: Create an app template in Mortar Deploy the app to a B2G Desktop build Iterating on your app is easy with Firefox Nightly
  • 10. Mortar $ git clone https://github.com/mozilla/mortar.git $ cd mortar && npm install $ ./bin/build app-stub demo-app B2G Desktop Build $ $ $ $ wget http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/... git clone https://github.com/mozilla-b2g/gaia make -C gaia profile /path/to/b2g -p gaia/profile
  • 12. Easy Payments Support for paid apps... mozmarket.receipts.verify(...); ... and in-app payments ... let req = mozmarket.buy(...); req.sign(jwt);
  • 13. Firefox Nightly All your standard developer tools, now in-built! Responsive layout preview DOM Tree Inspector (also available in 3D!)
  • 14. Finishing Touches Packaging Only needed for certain types of apps Submit to the Marketplace!
  • 15. Happy Hacking! HTML / CSS / JS + Mortar / Bootstrap + Firefox Nightly / B2G Desktop Build = An amazing app! anant@mozilla.com