incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Commented] (CB-638) Slow native bridge (especially android)
Date Fri, 04 May 2012 17:10:48 GMT


Joe Bowser commented on CB-638:

I don't think that switching to addJavascriptInterface itself will work, since we'll still
have to use polling to get the async response.  The only difference is that this will be cleaner.
 Java classes added to the application are synchronous by default, and the only way that Android
can call Javascript on its own is by using WebView.loadURL, which calls the old WebKit C method
stringByEvaluatingJavascriptString, but this also interrupts the UI thread. We work around
this by adding a callback server and using an XHR to listen to the server for callbacks. 
In the case that a server connection can't get established, we use polling.

So, it's not just about using addJavascriptInterface, although I would love to go back to
using it for input, because it would make the code a LOT cleaner.

> Slow native bridge (especially android)
> ---------------------------------------
>                 Key: CB-638
>                 URL:
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Lee Crossley
> Doing many native callbacks (such as writing files) has a significant overhead.
>'s native bridge is more than 5 times faster than Cordova (on Android).
> I'd love to see similar performance stats in Cordova.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message