在Android Studio中嵌入人行横道 [英] embed crosswalk in android studio

查看:916
本文介绍了在Android Studio中嵌入人行横道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新关于Android编程和android工作室。
我研究了人行横道嵌入API为我的项目,并试图将它嵌入到机器人工作室。但我不能succesfull。连我自己也不知道到底可以嵌入具有gradle这个文件与否的API。

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. Even I don't know exactly how can embed an API that has gradle file or not.

也许有一个与系统的gradle一个问题?
总之,我怎么可以嵌入人行横道-的WebView我与Android的工作室一步一步的项目?
非常感谢你。

Maybe there is a problem with gradle system? In brief, how can I embed crosswalk-webview to my project with android studio step by step? Thanks a lot you.

推荐答案

以下内容:<一href=\"https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/\">https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/


  1. 打开AndroidStudio项目视图app文件夹编辑的build.gradle:

  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'}


  • 同步的项目。

  • sync project.

    在布局XML添加了这一观点。

    add this view in layout 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"
    />
    


  • 在活动或片段:

  • In activity or fragment:

    import org.xwalk.core.XWalkPreferences;
    import org.xwalk.core.XWalkView;
    


  • 在的onCreate:

  • 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);
    


  • 我的开箱即用的WebView的失败后成功地使用WebRTC技术在XWalkView在Android 4.3和4.4。我觉得Android的5棒棒堂达与最新的铬相提并论。

    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.

    这篇关于在Android Studio中嵌入人行横道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆