Android Studio import records for third-party libraries

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.