On Android, there are a range of OS versions that users are on. For details see Platform Versions. The WebView is the component of a Cordova app that renders the HTML page. The capabilities of this component vary depending on the version of Android the app is run on. See WebView for Android. Crosswalk provides a replacement for the Android WebView that is consistent across Android devices. One other benefit is that an app running on an older Android device can be debugged. With the standard WebView, only devices running Android 4.4 or higher can be debugged. Note that on Android 5.x devices, Google released an update for the WebView component. See Android System Webview Update.
The following sample attempts to illustrate the benefits of using Crosswalk. The following steps will create a project using the standard Android WebView and will demonstrate the result of it against a few test websites. A second project will be created using Crosswalk instead of the Android WebView.
Standard Cordova WebView
Cordova with Crosswalk
Kapsel Plugins with Crosswalk
Notes
cordova -d create C:\Kapsel_Projects\WebViewDemo com.mycompany.webview WebViewDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
cd C:\Kapsel_Projects\WebViewDemo
cordova -d platform add android
cordova -d plugin add org.apache.cordova.device
cordova -d prepare
C:\Crosswalk
Crosswalk 11.x supports Cordova 4.2 and uses Chromium 40. See Release Notescd C:\Crosswalk\crosswalk-cordova-11.40.277.7-arm\bin
create.bat C:\Kapsel_Projects\CrosswalkDemo com.mycompany.crosswalk CrosswalkDemo
cd C:\Kapsel_Projects\CrosswalkDemo
C:\Crosswalk\crosswalk-cordova-11.40.277.7-x86\framework\xwalk_core_library\libs\x86
toC:\Kapsel_Projects\CrosswalkDemo\CordovaLib\xwalk_core_library\libs
See also Multi-architecture packages.npm install -g plugman
Add the device plugin.plugman install --platform android --project . --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
It is also possible to migrate a Cordova application and then continue to use the Cordova CLI. See Migrate an application for further details.cd cordova
run.bat
The Kapsel Plugins can be added to a Crosswalk project.
plugman install --platform android --project . --plugin c:\sap\MobileSDK3\KapselSDK\plugins\logon --searchpath C:\sap\MobileSDK3\KapselSDK\plugins
When trying Crosswalk, I noticed the following things.
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
adb logcat
or
C:\adt-bundle-windows-x86_64-20140702\sdk\tools\monitor.bat
Use Host GPU
If this is not checked, the following fatal error prevents the application from starting.[FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
See also, http://stackoverflow.com/questions/29235649/cannot-get-crosswalk-helloworld-example-to-work//oHeaders['X-SMP-APPCID'] = applicationContext.applicationConnectionId; //not needed as this will be sent by the logon plugin
Back to Getting Started With Kapsel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 |