CordovaFirefoxOS
API shim development
Cordova | FirefoxOS | TODO / Progress | Status (%) | Developer |
---|---|---|---|---|
Accelerometer | devicemotion, DeviceMotionEvent.acceleration | 100% | ||
Camera | WebActivities, Pick image example | The problematic parts are specified in cameraOptions:
Currently only the response as URI is supported |
20% | zalun |
Capture | WebActivities | The main differences are in the object returned to the callbacks, some on-the-fly transition will be needed. | ||
Compass | deviceorientation | 100% | ||
Connection | navigator.connection | Cordova has a different object under the same navigator property name. FirefoxOS doesn't provide type of the connection to the apps. According to Harald' answer on StackOverflow "metered should be enough to tell if the user is on wifi".
|
||
Contacts | WebAPI/ContactsAPI | There are lacks in FxOS documentation of Contact fields (impp , url , address ). Some fields are not exactly corresponding to each other. FxOS has an ability to save only one organization. Cordova has no info about (anniversary , sex , genderIdentity )
|
||
Device | As for the moment FxOS does not provide any info about device to not certified apps. Following properties of device object will not returned: name , uuid , version , model
|
|||
Events | TBD (some of these will require a separate row in this table) | |||
File | TBD | |||
Geolocation | Using geolocation | Waiting for "resolved flag". CLI (prepare method) needs to have a new functionality - adding permissions to manifest.json - needs to be configurable, so user will be able to write description | 99% | Herm, zalun |
Globalization | TBD | |||
InAppBrowser | Browser | The implementation is very different. Cordova uses window.open which is working in different way under FxOS. FxOS uses an iframe with mozbrowser attribute.
|
||
Media | Playing and recording music files. "The current implementation does not adhere to a W3C specification for media capture, and is provided for convenience only. A future implementation will adhere to the latest W3C specification and may deprecate the current APIs". | |||
Notification | There is an issue with copying resources (CSS, PNG) when adding the plugin. (There is also no way of automatically adding the CSS file to HTML, which to me looks more like a feature.) | 99% | zalun | |
Notification.beep | TBD | |||
Notification.vibrate | Vibration | in review | 99% | |
Splashscreen | TBD | |||
Storage | TBD |
Repositories
- jlongster: https://github.com/jlongster/ (cli, plugman, firefoxos)
- zalun: http://github.com/zalun/ (plugin-dialogs, plugin-camera, plugin-device-motion, plugin-device-orientation, plugin-geolocation)
Running an early dev version
$ git clone https://github.com/jlongster/cordova-cli.git $ cd cordova-cli && npm install $ cd .. $ git clone https://github.com/apache/cordova-plugman.git $ cd cordova-plugman && git checkout ffos $ cd .. $ cd cordova-cli && npm install ../cordova-plugman $ cd .. $ git clone https://github.com/jlongster/cordova-firefoxos.git
Create a dir (possibly a bug it should be autocreated or used from another dir)
$ mkdir -p ~/.cordova/lib/firefoxos/cordova-firefoxos-dev/
Later on run cordova
from cordova-cli/bin/cordova
Running the latest stable cordova
$ npm install cordova -g
Create your app:
$ cordova create fxos-app
If you want to use the local firefoxos platform. Configure Cordova by editing .cordova/config.json in the fxos-app folder. Add the "lib" property, like this:
{ "id": "io.cordova.hellocordova", "name":"HelloCordova", "lib": { "firefoxos": { "uri": "/Users/james/projects/mozilla/tmp/cordova-firefoxos", "version": "dev", "id": "cordova-firefoxos-dev" } } }
Just change `uri` to make it point to your computer. Now you can add the platform
$ cordova platform add firefoxos
Add plugins from github or local disk
$ cordova plugin add https://github.com/jlongster/cordova-plugin-device.git $ cordova plugin add ../cordova-plugin-device
Prepare as usual
$ cordova prepare