What will you learn in this post?
To get started with Crosswalk, you may refer to the official document.
This step is very important! It won’t work without the following setting. Typically, we may want to declare them in
onCreate of our main
Here, we use
org.xwalk.core.XWalkSettings instead of
android.webkit.WebSettings, which is used in a standard Android application.
Declare a Class as Interface
Create a Java file named
JsInterface.js and edit it as follows.
Caution: If you’ve set your targetSdkVersion to 17 or higher, you must add the
In the main activity, add the following statement after
index.html that will be loaded in main activity, we create a link that will call
sayHello when clicked.
NativeInterface is the named in
You should now get the
Hello World! information from alert.