Assume:
-
you already have an working Ionic2 project with the name ionic2-project.
-
you have all dependencies added
Author: CodeDee
-
Change directory to YOUR ionic2 project
cd ionic2-project
-
Add Crosswalk cordova plugin to your project
ionic plugin add cordova-plugin-crosswalk-webview
Now you should see cordova-plugin-crosswalk-webview appear under plugin folder
|-- ionic2-project |-- app |-- node_modules |-- plugins |-- cordova-plugin-crosswalk-webview ... ...
-
Make sure that have installed latest version of Android Support Repository & Google Repository.
android
This will bring up Android SDK Manager, check if you have installed.
-
Add platform Android, if you have not
ionic platform add android
-
Run project in Andrdoid device
ionic run android
-
Now we have to verify if crosswalk is successfully packaged into your project.
Hint 1: Inspect the name of built APK
|-- ionic2-project |-- app |-- node_modules |-- plugins |-- platforms |-- android |-- build |-- outputs |-- apk |-- android-debug.apk **<-- if you see this, crosswalk isn't in** ... ... ... ... ... ...
Hint 2: Inspect useragent of your application with Google Chrome Developer Tools
Follow the following steps:
-
Launch Google Chrome then launch Developer Tools (⌥⌘I)
-
Attach your Android device to your machine
-
Expand the 3-dots menu located at top right of the window, go to More Tools > Inspect deivces...
-
You will now prompted with a Device windows
-
Pick your Android device then under your ionic2 project click Inspect
-
Key in below command in the console
navigator.userAgent
-
Verify your useragent string here:
https://github.com/crosswalk-project/crosswalk-website/wiki/crosswalk-user-agent
-
Congratulation! You have successfully added Crosswalk into your Ionic2 project.