Mobile/Fennec/Android/App Structure: Difference between revisions

From MozillaWiki
< Mobile‎ | Fennec‎ | Android
Jump to navigation Jump to search
(Created page with "Fennec is slightly more complicated than the average Android app, here's a brief overview of the most important components: * '''Java code''': ** Frontend: most of the Fennec...")
 
No edit summary
Line 6: Line 6:
** Services: firefox account code, and sync code
** Services: firefox account code, and sync code
*** mostly under mobile/android/services/*
*** mostly under mobile/android/services/*
** GeckoView: embeddable web browser widget, i.e. this lets us display web content within Android. Used to be extremely fennec specific, however there are efforts underway to make this reusable:
** GeckoView: embeddable web browser widget, i.e. this lets us display web content within Android. This used to be extremely fennec specific, however there are efforts underway to make it reusable in other apps:
*** Lives under mobile/android/geckoview/*
*** Lives under mobile/android/geckoview/*



Revision as of 11:39, 8 November 2016

Fennec is slightly more complicated than the average Android app, here's a brief overview of the most important components:

  • Java code:
    • Frontend: most of the Fennec specific UI, and also data storage code, i.e. most things that are Android specific
      • mostly lives under mobile/android/base/*
    • Services: firefox account code, and sync code
      • mostly under mobile/android/services/*
    • GeckoView: embeddable web browser widget, i.e. this lets us display web content within Android. This used to be extremely fennec specific, however there are efforts underway to make it reusable in other apps:
      • Lives under mobile/android/geckoview/*
  • Frontend javascript code: glue code between our Java UI and the gecko backend, it is used to control gecko and for interactions with web content. (We are able to push messages from Java->JS and JS->Java)
    • Example: handling of link long-presses: gecko detects long-press, fires "contextmenu" event. This is handled in browser.js (part of the frontend javascript code), passed to "contextmenus.show()", which prepares the context menu content, that uses the (also JS based) prompt code, to fire a "Prompt:Show" event (which includes the menu content, as assembled earlier), that is then handled in PromptService.java on the Java/Android side. Finally that invokes our Prompt implementation which deals with creating the actual on-screen menu using Java/Android code.
      • Many interactions involving web content are structured like this: gecko events are handled in our javascript glue code, before calling into the actually visible Java code.
    • Largely under mobile/android/chrome/* and mobile/android/components/*
    • A lot of generic browser code is in mobile/android/chrome/content/browser.js
  • Gecko: the actual web rendering engine, a mix of C++ and JavaScript code
    • lives all over the repository, outside of mobile/