Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use crosswalk-cordova inside of Android Studio?

Is it possible to build a crosswalk-cordova app inside of android studio?

It looks like you need to use ANT at this point.

Does anyone know if this is on the roadmap now that android studio is out of beta?

Our team just built an android wear app so we need to use android studio to create a build and we'd like to start using crosswalk.

like image 605
TWilly Avatar asked Aug 22 '14 16:08

TWilly


People also ask

Does Cordova need Android studio?

If you wish to run your Cordova app on an Android emulator, you will first need to create an Android Virtual Device (AVD).

What is Crosswalk plugin?

Crosswalk provides an improved WebView using an internal browser based on Chrome. For more information about loading the MobileFirst Crosswalk WebView see Loading the WebView.


2 Answers

I put together some instructions here: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/

You can do this with gradle by adding the maven repo:

repositories {
    maven {
        url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
    }
}

And then the version of crosswalk that you want:

compile 'org.xwalk:xwalk_core_library:10.39.235.15'

Sample Code: https://github.com/dougdiego/CrosswalkDemo

like image 60
ddiego Avatar answered Nov 03 '22 00:11

ddiego


I was able to get this working. You need to re-arrange the project structure a bit and use "modules" I created a CordovaLib module and a xwalk_core_library module both "Android Libraries" and i referenced CordovaLib from my main project and set xwalk_core_library as a dependability for cordovalib.

Make sure to create the xwalk_core_library under the package name org.xwalk.core.

See screen shot for project stucture and the xwalk_core_library gradle file.

Put the .so files into a jniLibs directory and the android build correctly packages them into your app.

I followed this article to help with building. I plan on setting up seperate builds for x86 and arm. http://ph0b.com/android-studio-gradle-and-ndk-integration/#mygradlefile

I have this working in this github project. Let me know if you run into any issues. https://github.com/twilly86/CrossWalkAndroidStudio

enter image description here

like image 42
TWilly Avatar answered Nov 02 '22 23:11

TWilly