Data Research - dcobbley/capstone-e GitHub Wiki
Information about the Device Storage API can be found here: https://developer.mozilla.org/en-US/docs/Web/API/Device_Storage_API
App permissions reference: https://developer.mozilla.org/en-US/Apps/Build/App_permissions Note that this also contains the earliest OS version that supports each of these. It looks like everything we'd be concerned with is available from before 1.4 with the possible exception of Firefox profiles.
Storage Areas
- sdcard is the name of both the sdcard and internal storage, for reasons I cannot explain.
- apps
- music
- pictures
- videos
We have to declare which of these areas we want access to in our application manifest; I'm assuming we'll take most, if not all, by the end of the project.
Reading files
We can either grab files by name or by iterating over files in one of the above storage locations. We'll probably be interested in the latter. See the code snippets on the Device Storage API page listed above for examples of how to do this.
Listening for Changes
It's possible to have events listen for changes made to storage areas. For things like pictures, music, or videos, watching for changes and keeping a log of changes may be a good way to specify what we need for incremental backups.
Finding SMS Messages
https://developer.mozilla.org/en-US/docs/Web/API/MozMobileMessageManager
We should be able to use getMessages() with a filter that grabs messages between the last backup and the current time; see here for details https://developer.mozilla.org/en-US/docs/Web/API/MozSmsFilter.
We may have to grab SMS data raw, though, because I'm not sure how to restore messages using this API.
Contacts
Backing up and restoring contacts should be relatively easy, since we can export and import them in the standardized vCard format; see the following example project for details: https://github.com/soapdog/firefoxos-sample-app-contact-exporter