Mobile/Distribution Files: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 5: Line 5:
* Search engines
* Search engines


==Current Implementation==
==Overview==
There are currently two ways distribution files can be ... distributed:
There are currently two ways distribution files can be ... distributed:
# A folder of distribution files is repackaged into the Android APK. During the first run, those files are extracted from the APK and stored in the /data/data/org.mozilla.firefox/distribution/* folder.
# A folder of distribution files is repackaged into the Android APK. During the first run, those files are extracted from the APK and stored in the /data/data/org.mozilla.firefox/distribution/* folder.
Line 14: Line 14:
* Preferences are set as "default" preferences on each run, since a "default" preference only lasts for the lifetime of the session. They are created as "default" preferences to allow "user" preferences to override them.
* Preferences are set as "default" preferences on each run, since a "default" preference only lasts for the lifetime of the session. They are created as "default" preferences to allow "user" preferences to override them.
* Lightweight themes are really only preferences too. The data for the theme must live online somewhere. A typical place are the AMO theme or getpersonas.com sites.
* Lightweight themes are really only preferences too. The data for the theme must live online somewhere. A typical place are the AMO theme or getpersonas.com sites.
* Search engine plugins must follow a fixed folder layout.
* Search engine plugins and add-ons must follow a fixed folder layout.


===Bookmarks===
==Bookmarks==
Default bookmarks are specified in '''/distribution/bookmarks.json'''. This file should contain an array of bookmark JSON objects with the following properties:
Default bookmarks are specified in '''/distribution/bookmarks.json'''. This file should contain an array of bookmark JSON objects with the following properties:
* '''title''': (required) string for the bookmark title
* '''title''': (required) string for the bookmark title
Line 36: Line 36:
  ]
  ]


===Preferences===
==Preferences==
Preferences are specified in '''/distribution/preferences.json'''. This file should contain a JSON object with the following properties:
Preferences are specified in '''/distribution/preferences.json'''. This file should contain a JSON object with the following properties:
* Global
* Global
Line 69: Line 69:
  }
  }


===Lightweight Themes===
==Lightweight Themes==
Lightweight themes are specified in the "Preferences" section of /distribution/preferences.json. Here is an example of the lightweight theme preferences needed for this to work:
Lightweight themes are specified in the "Preferences" section of /distribution/preferences.json. Here is an example of the lightweight theme preferences needed for this to work:


Line 79: Line 79:
  }
  }


===Search Plugins===
==Search Plugins==
Search plugins do no need to be listed in any file. Instead, create a directory structure like the following, and they will be
Search plugins do no need to be listed in any file. Instead, create a directory structure like the following, and they will be
automatically loaded:
automatically loaded:
Line 101: Line 101:
If a directory for the locale the browser is running in doesn't exist, Firefox will automatically try the 'default' locale, as defined by the distribution.searchplugins.defaultLocale preference.
If a directory for the locale the browser is running in doesn't exist, Firefox will automatically try the 'default' locale, as defined by the distribution.searchplugins.defaultLocale preference.


===Issues===
==Add-ons==
Add-ons do no need to be listed in any file. Instead, include them in an extensions directory as follows, and they will be
automatically loaded:
 
  * distribution/
    * extensions/
      * someaddon@somedomain.com.xpi
      * ...
 
Be sure to name the add-on XPI with the ID that's specified in the add-on's install.rdf.
 
==Issues==
* <strike>We need to ensure the files are not cleared or overwritten during an update. The Android "Manage Apps" system allows users to "Clear Data" and we need to verify this does not clear the files.</strike>
* <strike>We need to ensure the files are not cleared or overwritten during an update. The Android "Manage Apps" system allows users to "Clear Data" and we need to verify this does not clear the files.</strike>
* <strike>Since we extract from the APK during first run, if a user never runs Firefox but does update it, there is a chance the distribution files would never be extracted.</strike>
* <strike>Since we extract from the APK during first run, if a user never runs Firefox but does update it, there is a chance the distribution files would never be extracted.</strike>


The use of a /system file location for distribution files solves these issues.
The use of a /system file location for distribution files solves these issues.
Confirmed users
1,111

edits

Navigation menu