Hello I need some help regarding the communication between crosswalk and java.
I used to create phonegap apps and now I implement the code into crosswalk.
Before, in phonegap apps, I used to add these lines in Java:JavaScriptInterface
jsInterface = new JavaScriptInterface(this);
appView.getSettings().setJavaScriptEnabled(true);
appView.addJavascriptInterface(jsInterface, "JSInterface");
andpublic class JavaScriptInterface {
private Activity activity;
public JavaScriptInterface(Activity activiy) {
this.activity = activiy;
}
@JavascriptInterface
public void showLog(){
Log.v("blah", "blah blah");
}
}
and call from JS with window.JSInterface.showLog();But now, in crosswalk apps,
I get this error: The method getSettings() is undefined for the type
CordovaWebViewEDIT: I saw this
https://crosswalk-project.org/jira/browse/XWALK-3069 And it seems the
getsettings function wich is causing me problems is not awailable in crosswalk
9,10,11.. I tried with version 8 and the getsettings are working (no error) but
the calling still don't work (it says it cannot find the functionwich I'm
calling) and I'm using the exact same code. Could someone please provide a
small working example?I tried today the whole day and this is very important to
me, not mentioning that I'm in a really big hurry.Here's a simple sample app
where on backbutton press it should write to console "blah blah" but it gives:
"Uncaught TypeError: undefined is not a function" source:
file://android_asset/www/js/index.js
(40)https://www.wetransfer.com/downloads/45fc5d871a3e12afbfc0d3d78aaa9b0c20150108084250/2567488a9f124c8e478b920e006c2c4320150108084250/762b16Just
tell me please how to call a java function from with crosswalk (any crosswalk
version)
I can't find anywhere on the internet an example or sample or up to
date,correct documentation.
I really need to get this working. Please help!
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help