

Building Cordova apps for Firefox OS - jweathersby
https://hacks.mozilla.org/2014/02/building-cordova-apps-for-firefox-os/

======
thebokehwokeh2
Cordova is wonderful if you know how to use it. It allows for cross platform
apps with a single codebase.

The problem lies in how it is used. Our project tried to incorporate a ton of
native UI/UX conventions that screwed us over royally. CSS transitions,
layered divs, swipe gestures, all of these were far too complicated for a
little phone to handle. Stay away from these, and do simple hides and shows.
Or go the hybrid method of having barebones native wrappers and web-views
inside of those views.

The web (i.e. HTML/CSS/JS) promises a lot but mobile browsers are nowhere near
where they should be in terms of pure processing power. As of right now,
native is still the way to go.

~~~
Mikeb85
If you have Android Chrome, open this. Super smooth on Nexus 5 and Chrome...
[http://helloracer.com/racer-s/](http://helloracer.com/racer-s/)

~~~
Jare
There's very little processing power needed for that demo, outside access to
the GPU via WebGL for rendering. It's a completely different model from
HTML/CSS. And WebGL will not be available for Android WebViews (or iOS ones
for that matter) for quite a while yet.

~~~
frik
It's sad, Google and Apple try protect their walled garden app-stores by all
means.

Android 4.4+ are based on Chrome/blink for the WebView but they deactivated
the hardware acceleration for Canvas2D and removed WebGL support, as well as
Web Audio API. [1]

iOS 4+ support WebGL in the webkit engine, but it's only enabled for iAds. [2]

[1] [http://www.html5gamedevs.com/topic/1915-android-44-kitkat-
in...](http://www.html5gamedevs.com/topic/1915-android-44-kitkat-includes-
chromium-powered-web-view/)

[2] [http://en.wikipedia.org/wiki/WebGL](http://en.wikipedia.org/wiki/WebGL)
and the related discussion
[https://news.ycombinator.com/item?id=7265230](https://news.ycombinator.com/item?id=7265230)

~~~
andybak
I don't quite see the argument here. To quote from your link:

> Chrome for Android supports a few features which aren't enabled in the
> WebView, including:

If Google was trying to protect the app-store walled-garden - surely that
would mean the reverse? Currently in-browser games that bypass the appstore
completely have access to more features than native apps?

~~~
frik
Both companies cripple HTML5 support on their mobile OS. Developers are left
with almost no choice but to write native apps for their platform (if they
care about execution speed).

It fits perfectly in the picture that Apple doesn't allow alternative browser
engines. Chrome for iOS just embeds UIWebView and there is no Firefox for the
same reason. The JavaScript JIT is disabled for UIWebView, and only enabled
for Safari.app.

In an ideal world, one could write powerful HTML5 apps that run on Android,
iOS, FirefoxOS and desktop browsers. And AppsStores would allow one to add an
entry to the apps web URL or at least provide an non-crippled WebView so that
one can write a simple wrapper app (or use phonegap/etc).

~~~
Mikeb85
Google allows many browsers on Android, you can install Firefox or Aurora and
use Firefox apps. You can run all the newest HTML5 features on Chrome for
Android. The promise of HTML5 is the open web, not apps in the Google Play
store.

Right now I'm running WebGL apps on my Android phone, and in Chrome you can
put web apps on your homescreen with a single click in the menu. You don't
need to go through any store, and you can open it like any Android app from
the homescreen.

What's more open than that?

------
suyash
What is the advantage of creating Firefox OS using Cordova (if you're only
creating firefox os apps)?

If you all you need for firefox os apps are: html, css, js then why do I need
to add additional cordova library? The big plus of Cordova is you can use
HTML5 and write apps that run on other platforms where HTML5 is not natively
supported but Firefox OS claims to be HTML5 first.

Cordova seems useless for FireFox OS apps..specially if I'm not using Cordova
for any other platform, since performance wise it's not as fast as native on
Android/iOS.

~~~
jlongster
There is no advantage of using Cordova if you're only creating Firefox OS
apps.

The advantage is if you are already using Cordova to write cross-platform HTML
apps, you can simply run `cordova platform add firefoxos` and it'll run on
Firefox OS now (barring any issues with the API shims).

Eventually, the Web APIs supported in Firefox OS will hopefully become the
standard APIs for hardware access, and Cordova will change their APIs to match
it, and in the end you will just need to write apps against the Web APIs and
we can get it to run everywhere. But we are not there yet.

