XUtils3 的 環境搭建,xutils3環境搭建

來源:互聯網
上載者:User

XUtils3 的 環境搭建,xutils3環境搭建

XUtils3 的 環境搭建

環境搭建三部曲

-----------------------

說明 :

author  修雨軒陳
使用andorid Studio 已經建立了一個項目

並且自己需要使用xutils 3.0.x

-----------------------

第一部: 資源下載

在github上下載最新版本.

https://github.com/wyouflf/xUtils3

解壓到之後

查看解壓的內容,:

將xutils檔案加 添加到專案檔下. (注意檔案的目錄結構) 將所有的檔案添加在項目的根目錄下,比如我的項目叫做"yixueyuan"

第二步:

在xutils目錄下, 查看build.gradle 檔案 ,如下:

將xutils下的build.gradle下的版本和app目錄下的版本要一致.,如下

在項目下的 setting.gradle 中添加xutils , 樣本如下:

最後 在 build.gradl中添加:

dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

樣本如下:

Sync Now 同步

經過漫長的等待之後,應該就可以用了。

第三部:使用xutils

經過前兩部的之後 , xutils環境就已經配置好 , 下面就是使用xutils了。

建立自己的Application : 並且覆蓋application的OnCreate()方法,

@Override
public void onCreate()
{
     super.onCreate();
     x.Ext.init(this);// xutils init ...
}

執行個體如下:

在AndroidManifest.xml 的application標籤中使用

android:name= <Application的路徑……>

好了 , okey 啦~~~

環境搭建好了~~~~~~

 

總結:

 

其實其他的類庫也是可以使用這種方式添加的 , 不在一一舉例

 

買一贈一: 下一節介紹一下xutil3的簡單使用方法.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.