CordovaFirefoxOS: Difference between revisions
No edit summary |
|||
Line 127: | Line 127: | ||
==Running an early dev version== | ==Running an early dev version== | ||
<pre> | <pre> | ||
$ git clone https://github.com/ | $ git clone https://github.com/mozilla-cordova/cordova-cli.git | ||
$ cd cordova-cli && npm install | $ cd cordova-cli && npm install | ||
$ cd .. | $ cd .. | ||
Line 135: | Line 135: | ||
$ cd cordova-cli && npm install ../cordova-plugman | $ cd cordova-cli && npm install ../cordova-plugman | ||
$ cd .. | $ cd .. | ||
$ git clone https://github.com/ | $ git clone https://github.com/mozilla-cordova/cordova-firefoxos.git | ||
</pre> | </pre> | ||
Create a dir (possibly a bug it should be autocreated or used from another dir) | Create a dir (possibly a bug it should be autocreated or used from another dir) | ||
Line 149: | Line 149: | ||
<pre> | <pre> | ||
$ cordova create fxos-app | $ cordova create fxos-app | ||
$ cd fxos-app | |||
$ cordova platform add firefoxos | $ cordova platform add firefoxos | ||
</pre> | </pre> | ||
Add plugins from github or local disk | Add plugins from github or local disk | ||
<pre> | <pre> | ||
$ cordova plugin add https://github.com/ | $ cordova plugin add https://github.com/mozilla-cordova/cordova-plugin-device.git | ||
$ cordova plugin add ../cordova-plugin-contacts | $ cordova plugin add ../cordova-plugin-contacts | ||
</pre> | </pre> |
Revision as of 04:21, 20 March 2014
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 | Some fields are not exactly corresponding to each other. Some information might be lost if contact is saved by Cordova based app. Awaiting merge to Cordova dev version. | 99% | zalun |
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, jlongster |
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 |
Running an early dev version
$ git clone https://github.com/mozilla-cordova/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/mozilla-cordova/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 $ cd fxos-app $ cordova platform add firefoxos
Add plugins from github or local disk
$ cordova plugin add https://github.com/mozilla-cordova/cordova-plugin-device.git $ cordova plugin add ../cordova-plugin-contacts
Prepare as usual
$ cordova prepare
Manifest issues
Manifest is automatically created with every ``cordova prepare``. There should be a mechanism to provide these values in a configuration file.
Privileged issue
Default index.html
created after cordova prepare
contains inline javascript. The (temporary) solution is to remove inline script and add document.onload = app.initialize();
at the end of the www/js/index.js
file.
Comparing Contacts find/search API
Fields in both APIs are different there are differences in the search API as well. There are also differences between versions of FFOS (1.2 and 1.3).
Searching by text fields
Cordova | FFOS 1.2 | FFOS 1.3 |
---|---|---|
displayName | - (name) | name |
nickname | - (nickname) | - (nickname) |
name (entire object) | familyName givenName - (additionalName) |
familyName givenName - (additionalName) |
phoneNumbers | tel | tel |
categories | category | category |
emails |