Android Studio怎么用gradle把github的一个开源库添加进来

Android Studio怎么用gradle把github的一个开源库添加进来

 repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:18.0.+'
    compile 'com.android.support:appcompat-v7:18.0.+'
    compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:+'
}

在你的buildg.radle中找到
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/commonapi.jar')
compile files('libs/gson-2.2.2.jar')
compile files('libs/voicechange.jar')
compile files('libs/voicecodec.jar')
compile(name: 'liveplayer:0.118', ext: 'aar')
compile(name: 'videosdk:1.218', ext: 'aar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile project(':slidingmenu_library')
compile files('libs/greendao-2.1.1-SNAPSHOT.jar')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.zhy:autolayout:1.4.3'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
testCompile 'junit:junit:4.12'
compile files('libs/umeng-analytics-v5.6.1.jar')
}然后你就可以在里面加载第三方库了