Add a jar package file to Android Studio

Source: Internet
Author: User

1. Add a Jar file

Copy the jar file to the Libs folder under the App module directory, then open the configuration file under the App module directory and build.gradle dependencies add the configuration command to the item, here

1 introduction of all jar files in Libs directory at once 2 Compile filetree (include: [' *.jar '], dir: ' Libs ')345 importing jar files individually  6 Compile files (' Libs/universal-image-loader-1.8.6-with-sources.jar ')

2. Add a third-party library by configuration

Example: Introduction of Butterknife third-party library

Git:https://github.com/jakewharton/butterknife

1> add apt to the Build.grade file in the project root directory

Buildscript {  repositories {    mavencentral ()   }  dependencies {    ' com.neenbedankt.gradle.plugins:android-apt:1.8 '  }}

2> introduction of APT and Butterknife configuration in the app directory Build.grade

1 Apply plugin: ' Android-apt ' 2  3android {  4  ... 5 }  6  7Dependencies {  8   compile ' com.jakewharton:butterknife : 8.4.0 ' 9   apt ' com.jakewharton:butterknife-compiler:8.4.0 'Ten }

Add a jar package file to Android Studio

Related Article

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.