Hi Alex, Thank you for trying Crosswalk!
How about to removing appView.getSettings().setJavaScriptEnabled(true); directly? Does it work? The ENABLE_JAVASCRIPT in Crosswalk is enabled by default so you don’t need to add this line in your code. Please refer to https://github.com/crosswalk-project/crosswalk/blob/master/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkPreferencesInternal.java There are some discussion about the method "getSettings()" in https://crosswalk-project.org/jira/browse/XWALK-3313, Crosswalk may not support getSettings() anymore. About XWalkSetting, a few things moved to Class XWalkPreferences (https://crosswalk-project.org/apis/embeddingapidocs_v3/index.html ) and some others are implemented in XWalkView e.g. The User Agent customization will be available in Class XWalkView. on Crosswalk 12 by public void setUserAgentString(String userAgent); Please refer to https://crosswalk-project.org/documentation/about/faq.html#Embedding-API , as the FAQ said, If you have a specific need, you should create a feature request in the Crosswalk Project JIRA and specify your use-case and requirements for the API. Our project manager and development team will evaluate the feature requests and implement them. BR Belem From: Crosswalk-help [mailto:[email protected]] On Behalf Of Alex Stanese Sent: Friday, January 09, 2015 3:10 AM To: [email protected] Subject: [Crosswalk-help] Need urgent help! 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"); and public 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 CordovaWebView EDIT: 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<file:///\\android_asset\www\js\index.js> (40)https://www.wetransfer.com/downloads/45fc5d871a3e12afbfc0d3d78aaa9b0c20150108084250/2567488a9f124c8e478b920e006c2c4320150108084250/762b16 Just 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
