Open Web Apps and the Mozilla Labs Apps project


Published on

In this talk Rob will introduce the Mozilla Labs Apps project and the related technologies that are helping it happen. The aim of this project is to produce an apps eco-system on the Web that uses open technologies and gives developers and users the freedom to sell and use apps in the way they want.

Aside from the conceptual issues that this project tackles, Rob will also cover some of the JavaScript APIs that are being worked on to provide the necessary functionality for apps. It is these APIs that allow developers to create an immersive experience within their apps that they wouldn't have been able to achieve in the browser until now.

Published in: Technology, News & Politics
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Open Web Apps and the Mozilla Labs Apps project

  1. 1. P S AP ject E B s pro N W s Ap p aw kes PE Lab Ro bH O MozillaHi, I’m Rob Hawkes and I’m going to talk about the Mozilla Labs Apps project and what itmeans for the Web.
  2. 2. I work at Mozilla, a non-profit company who is fighting for a better Web.If you’re unsure about how much I love Mozilla then check out this beautiful chicken and leekpie with extra Firefox goodness.It was made by my talented girlfriend and it was delicious.
  3. 3. My official job title is Technical Evangelist but I prefer what it says on my business card.Part of my job is to engage with developers and designers like you and I about cool newtechnologies on the Web.I’m interested in everything that’s going on but my particular focus at Mozilla is on gamedevelopment using Web technologies.And for those of you with no idea of what a rawket is, I made a multiplayer game calledRawkets in which players fly around in little rockets and shoot each other in the face withHTML5 and JavaScript.It’s actually quite fun!
  4. 4. We might have enough time for questions at the end but feel free to grab me in person afterthis talk or on Twitter. I’m always happy to help.These slides will go online after this talk and they’ll be available from my personal website.I’ll put all the details up at the end.
  5. 5. Created by Phil Banks (@emirpprime)Now, it’s no secret that I spend most of my time experimenting with HTML5 and other cooltechnologies like JavaScript.If you’ve met me before then you probably already know about my slight addiction to HTML5canvas, visual programming, and gaming.
  6. 6. The concept of Web apps is something that is gaining a lot of traction at the moment.No doubt this is as a result of the success of native applications on the desktop and mobile,particularly with iOS and Android.What’s exciting is that HTML5 and JavaScript are now allowing developers to create appexperiences on the Web that can rival those on the desktop and mobile.But just having the technology isn’t good enough.
  7. 7. ion at situ etter nt be b rre ou ld Cu ing sc ThCurrently, app platforms are predominantly closed in either the technology required to makethe apps or the methods that are used to distribute them.Although these approaches do have their benefits they also put unnecessary constraints onthe developers and users of apps.It’s also not an ideal solution if we want an open Web.
  8. 8. je ct p ro eb p s W A p fthe bs good o La rthe zilla Fo MoAt Mozilla we think there is a better way, a way that puts the developers and users of appsback in charge.We think there is a way that embraces open technology and is for the good of the Web.We call it the Mozilla Labs Apps project and we’re working hard to make it a reality.
  9. 9. ach Re rm tfo s-pla cros ed us be an sc AppIt allows you to create rich HTML5 app experiences that run across multiple devices and formfactors (desktop, mobile, tablet, etc.)
  10. 10. g y o lo ch n es e sit n t ew eb pe om ak O us et eady alr ou ty WhaIt allows you to use Web standards and open technologies such as HTML5, CSS andJavaScript.Anything you currently use to build a website with can be used to build an app.
  11. 11. oice f ch ol o on tr o m ers in c ed Fre d consum an vs de tting PuIt puts you in control of every aspect of the app experience; from easy development, todistribution, to direct communication with your customers.
  12. 12. ie w rev r p wo rk p e nd velo theg rou De aying LRight now we’re in a limited Developer Preview to lay the groundwork and test things butwe’ll soon be opening that up so more people can try it out.
  13. 13. te d r ta app g s ttin te an Ge to crea HowCreating a Web app isn’t crazy hard, it’s just a case of understanding the new features inbrowsers.
  14. 14. tes bsi we olo gy ar e tec hn ps me Ap et he sa us ey ThApps are websites and are built using the same technology and processes.If you already know how to make a website then creating your first Web app is a breeze.
  15. 15. s ite e b e w ap ps th for in g on ality nd fun cti Exte g new ddin AThe Mozilla Labs Apps project proposes some additions to standard websites and introducesa few new JavaScripts APIs into the browser that help make apps an experience unlike anyother on the Web.If you don’t know JavaScript then don’t be put off, the amount that’s needed to make an appis relatively small and should make sense to you.However, I would definitely advise learning JavaScript development if you’re planning ongetting really involved in Web apps.
  16. 16. fe st n i a m o an a pp io n int a t ite plic we bs Ap rninga TuThe only thing that you need to do to turn a website into app is create an applicationmanifest.
  17. 17. { "version": "1.0", "name": "MozillaBall", "description": "Exciting Open Web development action!", "icons": { "16": "/img/icon-16.png", "48": "/img/icon-48.png", "128": "/img/icon-128.png" }, "developer": { "name": "Mozilla Labs", "url": "" }, "installs_allowed_from": [ "" ], "default_locale": "en" }This is a JSON file that effectively describes your application; it’s name, icons, and otherrelated data.
  18. 18. nts e irem ember q u t re ttor em fes tan ni mp or Ma IThere are a couple of important things to remember when creating an application manifest.
  19. 19. a in o m ty e d curi am nt of se S me ele AnThe first is that it needs to be hosted from the same domain as your Web app.This is pretty straightforward and it adds an element of security in that it is unlikely that arouge manifest file will be able to be put on the same domain without your knowledge.
  20. 20. Content-type header application/x-web-app-manifest+jsonThe second is that it needs to be served with a specific content type (application/x-web-app-manifest+json).This is probably the most tricky process in turning a website into an app as it involveschanging settings on your server or a bit of hackery in your manifest file.If you don’t want to fiddle with your server then you can always set the content-type headerusing something like PHP or Node.js.
  21. 21. Extension my-manifest-file.webappIt’s also recommended that the manifest file has an extension of .webapp, although this isn’tenforced.
  22. 22. to r a lid s ok va st hin g i nife everyt Ma su re king MaIf you want to make sure your manifest is valid you can have it checked at
  23. 23. p s a p lin g er tal bro ws Ins nt he oni so nd na sio xten ViaeYou can install and manage apps using an extension for Firefox on the desktop and anapplication for Android.We’re working on building the necessary functionality directly into Firefox, as well asproviding a JavaScript include that can be used in other browsers.
  24. 24. Installing an app navigator.mozApps.install(manifestUrl)Installing an app is achieved through the new mozApps JavaScript API, particularly the installmethod.By passing it a string URL to the app’s manifest file you will trigger the installation process.An example of when you would call this method is after a user clicks on an “Install this app”button on your own website.
  25. 25. The install method triggers an installation dialogue within the browser that allows the user todecide what to do with the app.
  26. 26. When installed, apps can be accessed and managed via a special dashboard during thedeveloper preview.This is available by accessing or clicking on the Apps link atthe bottom of the Firefox window.
  27. 27. Apps launched from the dashboard are opened in an application tab at the far left-hand sideof the tab bar.An application tab is different in that it has a much smaller visual footprint in the tab bar andthere is little browser UI cluttering the screen, like the address bar.
  28. 28. ion u t trib ey Dis dm on s an tore ps ApCreating an app is only half the story, the final chapter is distributing your app and getting itin the hands of users.There are a couple of prominent options here.
  29. 29. ne alo o it elf rs G it y ou do land tro on full c TakeThe first option is to provide the app only via your own website and do the leg work inregards to promotion.This option is an enticing one for developers who want full control over where and how theirapp is distributed.However, right now this is a tricky option if you want to charge for your app.
  30. 30. s rm fo ace lat g park etpl tin pM Exis illa Ap Moz he et LikThe second option is to use an existing platform like the Mozilla App Marketplace.There are many benefits to this option but the main ones are that you don’t need to worryabout payment systems nor have to do as much promotion.The marketplace uses PayPal and BrowserID to make the purchase and confirmation ofpurchase as easy as possible.
  31. 31. nce erie exp eb sit es ive ifie dw at lor N er jus tg long no are ps ApI think what is most interesting about the apps project is the ability to break away from theconcept of apps being nothing more than glorified websites.Instead, the new functionality allows Web apps to look and act much like native applicationsthat you would find in an operating system, rather than a website running within a browser.
  32. 32. RT eb W e OS th ithin sw pp ga llin InstaWe call this WebRT (Web run-time) and it’s really cool.It allows you to install Web apps in the operating system as if they were a native application.Right now, WebRT is supported on Windows, Mac, and Android.It’s built into the Firefox extension, Android application, and JavaScript include that Imentioned earlier for installing and managing apps.
  33. 33. It’s really easy to use and you don’t need to do anything special as a developer to enable it inyour app.Whenever a user requests to install an app they will see an option to install it natively.
  34. 34. ock e d th reen m ro or home sc f nch sktop, Lau or de …Apps installed using WebRT are no different to any other native application that you have onyour computer.They’re installed in a standard applications folder and can be launched in the same way thatyou launch any other application.For example, on the Mac your app would be installed in the ~/Applications directory.
  35. 35. U I ser row alo ne o b rs ou N an dy rs ou isy ation lic app TheWebRT applications use a browser rendering engine behind the scenes but don’t display anynormal browser UI that would clutter your app.Instead, WebRT apps look and feel like native applications while actually using HTML andJavaScript behind the scenes.
  36. 36. This is an example of my HTML5 game running as a WebRT application, check out the lack ofbrowser UI.Right now WebRT uses the version of Firefox you already have installed to grab the renderingengine. In the future you won’t necessarily need a browser installed and WebRT will handlegrabbing a relevant rendering engine behind the scenes.
  37. 37. gy olo c h n er rth d te even fu late ap ps Re shing PuAside from WebRT and the apps API there are many other Web technologies that help pushapps even further.
  38. 38. PI n A re e ul Sc we rf ull et po F im ple ,y SThe Full Screen API allows you to expand any HTML element to fill the users screen, even ifthe browser isn’t running full screen itself.It’s different to using the F11 shortcut for full screen a that makes the entire browser fullscreen and keeps the address bar and other UI if you place the mouse near the top of thescreen.With the Full Screen API only the specific HTML element that you choose will be made fullscreen and the browser UI will be hidden. It’s useful for things like video and games.
  39. 39. e ts ock bS ation e W omm un ic ec l-tim al rea ction ire Bi-dWebSockets is particular favourite of mine.It a JavaScript API that allows you to provide bi-directional real-time communication betweena browser and a server.This means you can instantly push data to and from the user as soon as it becomes available.
  40. 40. se ts a s line yw ay Off ern et an Int he st ed ne WhoTechnologies like the application cache, Local Storage, and IndexedDB allow for a website orapp to cache necessary assets to that it can still run while offline.This includes things like JavaScript files, CSS and images as well as standard key/value data.Combining these techniques will allow your application to continue working even if theInternet connection goes down. You just sync up all the changes when it gets connectedagain.
  41. 41. P Is e A evic cript D aS Jav ith arew ardw h ssing ce AcDevice APIs is a catch-all term for the technologies that allow developers to access hardwareand operating system APIs using JavaScript.
  42. 42. At Mozilla we’re working on the WebAPI effort which is our attempt at solving this problem.In other camps it might be referred to as DAP, which is the Device APIs Working Group whoare producing a W3C specification for accessing various parts of a device through JavaScript.In fact, we recently joined the DAP to collaborate and contribute to the existing efforts.The approach we’re taking is to try and replicate the functionality of a mobile phone withJavaScript.What APIs would you need to do that?
  43. 43. tes uri avo for y f ait tw M Ican no Is AP evice DThere are so many Device APIs in the pipeline when you combine all the efforts by the variousbrowser manufacturers.Here are just a few of my favourites.
  44. 44. PI A re tu phone ap ia C m icro ed era and M cam the ssing ce AcThe Media Capture API will let you access the camera and microphone on a device.Being able to do this with JavaScript will make a whole world of difference in so many areas.For example, instead of requiring a user to upload a profile image you could take one usingthe webcam and use that instead. Simple but effective.You could also do things like using the microphone input for voice recognition in for inputareas. I know Google are already experimenting heavily in this area.
  45. 45. P I A tery eft at eisl B juic uch m ow th ou FindThe Battery API is interesting because it allows you to find out how much power is remaining,or whether the device is currently being charged.
  46. 46. P I C A NF ion eb un icat W m om sc les wire -like RFIDThe WebNFC API is pretty cool.It gives you the ability to transmit and receive data within distances no larger than a fewcentimetres.The idea is that it can be used in phones for things like payment (like the new Barclaycard),travel (think Oyster Card), and file transfer.
  47. 47. P I n A tio ogies ibra hn ol V ent ec op ith youw ating VibrOr what about the Vibration API that gives you access to the vibration motors of a device.Apart from having a humorous name, it’s APIs like this are really going to change the waythat apps are created with JavaScript.
  48. 48. o re t m ou rces ind res ou F ion and ntat e ocum DI hope I’ve given you a taste for the Mozilla Labs Apps project and the potential for Web appsright now.There is much, much more to learn about them and the related technology.
  49. 49. One of the places to check out for general information is the apps section on the Mozilla Labswebsite.
  50. 50. For technical information the apps section of the Mozilla Developer Network is the place togo.It’s full of clear documentation on every detail of the project so far and is being update all thetime.
  51. 51. u s lk to C Ta illa IR M oz on ps ap eb nw pe #oFor anything that can’t be answered by those websites you should get in touch with us.The developers and relevant apps-related people at Mozilla hang out in the #openwebappsroom on so definitely head over there if you have any particular questions orconcerns.We’ll be happy to help.
  52. 52. Rob Hawkes @robhawkes Personal website and blog RECENT PROJECTS MORE COOL STUFF Twitter sentiment analysis Rawket Scientist Delving into your soul Technical Evangelist at Mozilla HTML5 & WebSockets game Web development podcastGet in touch with me on Twitter: @robhawkesFollow my blog (Rawkes) to keep up to date with stuff that I’m working on: http://rawkes.comI’ve recently worked on a project that analyses sentiment on Twitter: is my multiplayer HTML5 and JavaScript game. Play it, it’s fun:
  53. 53. Ask MDN Coming back this year Web development topics ASKMDN Hand-picked experts Great discussions @ASKMDN & #ASKMDN ON TWITTERAnd lastly, I’d like to quickly mention Ask MDN which is a project that I’m working on atMozilla.The concept is simple; every so often we gather a bunch of experts to answer your questionsabout a particular topic.We’ve had a whole bunch of sessions to date and it’s going down really well. If you follow@AskMDN on Twitter you’ll be sure not to miss the next one when it starts again this year.
  54. 54. O U Y s? K tion N ues A yq TH An R b es wk es Ha wk ob ha ro @Thank you.If you have any questions feel free to grab me on Twitter (@robhawkes) or