Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by jamesbrady on Friday February 24, 2012 @02:19PM
(#3630544)
Hey Patrick, we support from v2.0 upwards, although not as heavily tested on 2.0 and 2.1. Our tooling actually sets users up with an AVD, and our docs (http://docs.trigger.io/en/v1.2/android/getting-started.html) do say that 2.3 is not supported on the emulator.
Although we obviously can't test every device out there, everything so far points at no device ever actually shipping with JSC after 2.2, e.g. see http://code.google.com/p/android/issues/detail?id=12987
If we do get requests from our users to change that approach, we'd obviously consider it, but at the moment, we think the significant performance and code cleanliness benefits outweigh the downside.
From what I could tell, the bug was shipped starting with some version of Android 2.x (I'm thinking 2.2) where JSC was used as the internal JS engine for WebKit instead of V8. When the Android devs added V8 support, they actually broke JSC support. It's a device manufacturer choice (or was) as to which JS engine to use. Curiously, Android shipped the 2.3 simulator image (guess that was the version) with JSC support, thus, "it was broken".
The API in question is `WebView.addJavascriptInterface()`. That method returned successfully, but whenever you accessed the interface from JS, you'd trap.
Could be this was only on the simulator, but - I'm thinking folks saw this on devices as well. Maybe those devices are no longer relevant?
Presumably Cordova will revert back to using `WebView.addJavascriptInterface()` when it's safe to do. The problem is, it's not clear when it's safe to do so. It's also not clear how you can test your JS environment to see if "it's safe", programmatically. Or maybe you can (eg, throw an Error, check for existence of error.stack), but ... it's wasn't a comfortable situation to be in.
Do you have some references that the 'bug' doesn't ship on devices, or that it no longer ships on simulator images?
What versions of Android SDK/simulator/devices does Trigger.io support? Presumably you don't support running Android 2.3 on the simulator, as your code would trap?