Reprint please indicate the source :
http://blog.csdn.net/lxk_1993/article/details/50493582
This article is from: "lxk_1993 's blog";
Android Studio imports records for third-party libraries. Jar Packages and libraries
One,jar package
1.jar package is very easy, first switch to project mode. Copy the jar package you want to use below lib.
2. Then right-click on add as Libary( more than one jar will just have to choose one just to join it ).
3. Or press and hold shirt + CTRL + ALT + S and then add the selected file as seen in the figure.
Second, the library
1. First download the library you need, and then copy it to your project folder.
2. Then create a new Build.gradle file under the newly added library directory. Code such as the following
Buildscript {repositories {mavencentral ()} dependencies {//It's going to be the following with your project.Build.gradleinside theClasspathsame Classpath' com.android.tools.build:gradle:1.5.0 ' }}applyplugin:' Com.android.library 'dependencies {//This is the package you want to rely on. Compile' com.android.support:appcompat-v7:23.1.1 ' Compile' com.android.support:support-v4:23.1.1 '}android {//Compile version number select your own maximum version number Compilesdkversion at Buildtoolsversion"23.0.1" Defaultconfig {//Here, you need to make your own changes . Minsdkversion the Targetsdkversion at } sourcesets {main {java.srcdirs = [' src '] Resources.srcdirs = [' src '] Aidl.srcdirs = [' src '] Renderscript.srcdirs = [' src '] Res.srcdirs = [' Res '] Assets.srcdirs = [' Assets '] Manifest.srcfile' Androidmanifest.xml ' } }}3. Picture your face in 1 settings.gradleAdd it inside
': dependent on the name of the library '
like include ': App ' , ': library '
4. Then add the following in the app folder under Build.gradle dependencies Compile project (': name of dependent library ')
Like what:
Android Studio import records for third-party libraries