Search code examples
androidcordovahybrid-mobile-appcrosswalk

Using crosswalk standlone without cordova


I am building an hybrid android app using crosswalk webview as my app needs webrtc support. I have a query in my mind as cordova webview is not stable over android versions and also do not have webrtc support therefore we add crosswalk plugin ,then why not use use crosswalk standalone . In this case we will also have some control over native features of android. THen what is the advantage of using cordova + crosswalk over using crosswalk webview alone.


Solution

  • You can do it, I have and there are some things you need to be aware of. You will run into errors, the crosswalk community is way smaller, and therefore some solutions to your errors will be harder to find in the usual places.

    Then you will have to make some decisions (space-wise). In crosswalk you have Shared and Embedded modes.

    https://crosswalk-project.org/documentation/shared_mode.html

    You will run into some trouble with embedded mode and testing with x86 and 64-bit phones. (You need to change your gradle dependency to 64-bit). With proguard and architecture splits you can package your app to a "reasonable" size ( under 40mb ), depending on the contents of your assets folder. (Embedded mode)

    As a java developer, I don't see the advantage of using cordova + crosswalk in most projects, but I do wish that the documentation available for crosswalk would be updated more frequently.

    To get started, add this to your gradle file:

    repositories {
        mavenLocal()
        maven {
            url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
        }
    }
    
    dependencies {
        compile 'org.xwalk:xwalk_core_library:20.50.533.12'
    }