embed crosswalk in android studio

前端 未结 5 1522
有刺的猬
有刺的猬 2020-12-01 07:12

I\'m new about android programming and android studio. I researched crosswalk embed API for my project and tried to embed it in android studio. But I couldn\'t be succesfull

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 07:39

    Following: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/

    1. Open AndroidStudio to project view in app folder edit build.gradle:

      repositories {
      maven {
      url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'}}
      
      
      dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:21.0.3'
      compile 'org.xwalk:xwalk_core_library:10.39.235.15'}
      
    2. sync project.

    3. add this view in layout xml.

      
      
    4. In activity or fragment:

      import org.xwalk.core.XWalkPreferences;
      import org.xwalk.core.XWalkView;
      
    5. in onCreate:

      XWalkView xWalkWebView=(XWalkView)findViewById(R.id.xwalkWebView);
      xWalkWebView.clearCache(true);
      xWalkWebView.load("http://...", null);
      // turn on debugging
      XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
      

    I've successfully used WebRTC in XWalkView on android 4.3 and 4.4 after failing with the out of the box WebView. I think the android 5 Lollipop is up to par with latest chromium.

提交回复
热议问题