incubator-callback-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/CB-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268543#comment-13268543
] 

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: https://issues.apache.org/jira/browse/CB-638
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Lee Crossley
>
> Doing many native callbacks (such as writing files) has a significant overhead.
> Trigger.io's native bridge is more than 5 times faster than Cordova (on Android). http://trigger.io/cross-platform-application-development-blog/wp-content/uploads/2012/02/chart_1-21.png
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message