在Android工作室嵌入人行横道

ied*_*mrc 9 android-library android-studio build.gradle crosswalk-runtime

我是关于android编程和android studio的新手.我为我的项目研究了人行横道嵌入式API,并尝试将其嵌入到android studio中.但我不能成功.即使我不确切知道如何嵌入具有gradle文件的API.

也许gradle系统有问题?简而言之,我如何逐步将crosswalk-webview嵌入到我的项目中?非常感谢你.

Rub*_*uck 30

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

  1. 打开AndroidStudio以在app文件夹中编辑视图build 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'}
    
    Run Code Online (Sandbox Code Playgroud)
  2. 同步项目.

  3. 在布局xml中添加此视图.

    <org.xwalk.core.XWalkView
    android:id="@+id/xwalkWebView"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000000"
    />
    
    Run Code Online (Sandbox Code Playgroud)
  4. 在活动或片段中:

    import org.xwalk.core.XWalkPreferences;
    import org.xwalk.core.XWalkView;
    
    Run Code Online (Sandbox Code Playgroud)
  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);
    
    Run Code Online (Sandbox Code Playgroud)

在使用开箱即用的WebView失败后,我在Android 4.3和4.4上成功地在XWalkView中使用了WebRTC.我认为android 5 Lollipop与最新的铬相当.