SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
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

Mais conteúdo relacionado

Mais de Anant Narayanan

WebRTC: User Security & Privacy
WebRTC: User Security & PrivacyWebRTC: User Security & Privacy
WebRTC: User Security & PrivacyAnant Narayanan
 
Firefox Architecture Overview
Firefox Architecture OverviewFirefox Architecture Overview
Firefox Architecture OverviewAnant Narayanan
 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-OnsAnant Narayanan
 
An Overview of Distributed Debugging
An Overview of Distributed DebuggingAn Overview of Distributed Debugging
An Overview of Distributed DebuggingAnant Narayanan
 
A Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionA Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionAnant Narayanan
 
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 BrowserAnant Narayanan
 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An OverviewAnant Narayanan
 
Innovating with Mozilla Labs
Innovating with Mozilla LabsInnovating with Mozilla Labs
Innovating with Mozilla LabsAnant Narayanan
 
Glendix: The Why and the How
Glendix: The Why and the HowGlendix: The Why and the How
Glendix: The Why and the HowAnant Narayanan
 
Introduction to XPConnect
Introduction to XPConnectIntroduction to XPConnect
Introduction to XPConnectAnant Narayanan
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsAnant Narayanan
 
Introducing Plan9 from Bell Labs
Introducing Plan9 from Bell LabsIntroducing Plan9 from Bell Labs
Introducing Plan9 from Bell LabsAnant Narayanan
 
Extending Python with ctypes
Extending Python with ctypesExtending Python with ctypes
Extending Python with ctypesAnant Narayanan
 
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 DojoAnant Narayanan
 

Mais 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

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 WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

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