Search code examples
javajavascriptandroidcrosswalk-runtime

Crosswalk call js function from java on android


I m trying to use crosswalk runtime in my android app. I tried this on android 4+.

I got some js & html codes and it worked perfect for me. But it is not working like android webview. In the webview i can call javascript functions from java code. But i couldnt find any option in crosswalk. Any idea?

Thanks


Solution

  • Crosswalk support the similar API interface (evaluateJavascript) as Android WebView for calling JavaScript function from Java:

    https://crosswalk-project.org/apis/embeddingapidocs/reference/org/xwalk/core/XWalkView.html#evaluateJavascript(java.lang.String, )

    You can also use load for calling javascript function directly like: xwalkView.load("javascript:" + jsCode, null).

    did you meet any issue with the Crosswalk API?