Community:SummerOfCode16/AndroidDownloadableContent
One ongoing goal of the Firefox for Android team is it to reduce the APK size (See meta bug "fatfennec": bug 942609). We just made the first steps to stop shipping everything in the APK and instead download assets the application needs at runtime. We started with fonts but we want to move much more content out of the APK (hyphenation dictionaries, translations, ..).
The goal of this Google Summer of Code project is it to remove hyphenation dictionaries from the APK and download them at runtime. The work previously done to exclude fonts acts as a blueprint and for your guidance.
- Skills needed: Java / Android, JavaScript or C++ helpful but not a requirement
- Mentor: Sebastian Kaspari (:sebastian) <skaspari@mozilla.com>
- IRC: irc.mozilla.org #mobile
Next step: March 14 - 25, 2016 - Students can register and submit their applications to mentor organizations. (Application Advice)
Getting ready
Before starting the project and maybe even before applying for GSoC get familiar with the codebase and how to contribute patches to Firefox for Android:
- Build environment: Create a build environment for building Firefox for Android: Simple Firefox for Android build
- A "front-end" build will be enough for most of the tasks and is much faster. However if you are going to edit C++ code you will need to setup a "back-end" build.
- Write patches: To get familiar with the code base, the tools and creating patches, pick one of the mentor bugs that matches your skill set: Bugs Ahoy!
- Those bugs have a mentor assigned. The mentor will help you and answer your questions.
The project
Groundwork
- For downloading fonts at runtime we implemented a background service that uses a static catalog of downloadable content. See dependency tree.
- Currently in development is a client that synchronizes the catalog of downloadable content from a Kinto server. See Bug 1201059
Project tasks
Preparation
- Create a build without hyphenation dictionaries (MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
- Verify that the build behaves correctly with the absence of the dictionaries (Are pages still readable? No crashes?)
- Create or find a test page that you can use to easily test if a hyphenation dictionary by a build (For testing later).
Main tasks
- Bug 1175555 - Exclude hyphenation dictionaries from builds via build flag - Already done
- Bug ??? - Package hyphenation dictionaries for ref tests - See similar bug for fonts: Bug 1197716
- Bug ??? - Verify that (or add code so that) Gecko can load hyphenation dictionaries from a profile independent directory - See similar bug for fonts: Bug 1197717
- Bug ??? - Add hyphenation dictionaries to static catalog of downloadable content
- Bug ??? - Modify DownloadAction (of DownloadContentService) to handle new type of content
- Bug ??? - Add a way to let Gecko know that the dictionaries have changed and that it should rebuild its list
- Bug ??? - Add hyphenation dictionaries to online catalog of content in Kinto
Landing
- Bug ??? - Land your changes behind a Nightly flag
- Verify that Nightly behaves correctly and the hyphenation dictionaries are downloaded
- Bug ??? - Let your changes ride the trains
Code
The existing (Java) code for downloadable content can be found in the org.mozilla.gecko.dlc package.
Follow-up project
For a very experienced developer the hyphenation dictionaries project could be too small for a 3 month period. There's a follow-up project about adding support for downloading localization files at runtime (Bug 945123). But this project contains much more unknowns and research tasks which makes it hard to estimate.
Bonus tasks
- There are various open follow-up bugs to improve the background service for downloading content as well as the sync client (Actual list of bugs TBD).
FAQ
- What are hyphenation dictionaries?
- Hyphenation dictionaries define how words in a specific language can be broken in parts, see Wikipedia. Those are the hyphenation dictionaries in the tree.