Mobile/AddonsTrainingWeek/SpeakerNotesA: Difference between revisions

no edit summary
(Created page with "* Download the latest release or nightly version of Firefox for mobile (Fennec) ** [http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-linux/ Nightly Li...")
 
No edit summary
Line 1: Line 1:
* Download the latest release or nightly version of Firefox for mobile (Fennec)
==Building an Add-on for Firefox (mobile)==
* Download the latest release or nightly version of Firefox for mobile (Fennec).
** [http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-linux/ Nightly Linux]
** [http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-linux/ Nightly Linux]
* Launch the browser and make sure the browser is functioning correctly
* Launch the browser and make sure the browser is functioning correctly.
* Setup some preferences that will make it easier to debug problems. Go to about:config
* Setup some preferences that will make it easier to debug problems. Go to about:config.
** [https://developer.mozilla.org/en/Setting_up_extension_development_environment#Development_preferences MDC page]
** [https://developer.mozilla.org/en/Setting_up_extension_development_environment#Development_preferences MDC page]
** javascript.options.showInConsole = true
** javascript.options.showInConsole = true
** browser.dom.window.dump.enabled = true
** browser.dom.window.dump.enabled = true
** extensions.logging.enabled = true
** extensions.logging.enabled = true
* Start editing the boilerplate of your add-on
* Start editing the boilerplate of your add-on.
** Download the blank template or use the tool of your choice
** Download the blank template or use the tool of your choice.
** Unpack or create add-on in a development folder
** Unpack or create add-on in a development folder.
** Use the editor of your choice
** Use the editor of your choice.
** [https://developer.mozilla.org/En/Building_an_Extension MDC page]
** [https://developer.mozilla.org/En/Building_an_Extension MDC page]
* Make a test link from the profile folder to your add-on development folder
* Make a test link from the profile folder to your add-on development folder.
** [https://developer.mozilla.org/En/Building_an_Extension#Test MDC page]
** [https://developer.mozilla.org/En/Building_an_Extension#Test MDC page]
* Launch the browser and verify that your add-on installed
* Launch the browser and verify that your add-on installed.
** If the add-on did not install, check the error console for potential problems
** If the add-on did not install, check the error console for potential problems.
* Now start adding more functionality to your add-on and keep testing in the browser
* Now start adding more functionality to your add-on and keep testing in the browser.
* When ready, ZIP the contents of your add-on development folder into a XPI and post to AMO
* When ready, ZIP the contents of your add-on development folder into a XPI and post to AMO.
 
==Porting an Add-on from Desktop to Mobile==
* UI is very different.
** You will not be able to assume the desktop XUL overlays will "just work".
** Dialogs and Preferences are handled very differently.
** Screen size becomes very important and a limiting factor.
** Maintaining "touch-friendly" widgets is critical.
** Simplify everything.
* JS front-end API's are very different.
** XPCOM and features of the Mozilla platform are the same.
** JS API's found in the UI code are different.
** Out-of-process web content makes common tasks and patterns very different.
* Guidelines
** Larger add-ons should not be ported "all at once". Break the add-on into smaller pieces and port each piece individually.
** Porting non-UI code should be straight forward, but scan XPCOM components and JSM's for potential UI problems.
** Out-of-process web content has a bit of a learning curve, but once you become comfortable with processing messages, you start moving faster and become more productive.
canmove, Confirmed users, Bureaucrats and Sysops emeriti
2,798

edits