Importing JAR Packages
The way to import a jar package is simply to put the jar package you need to import into the Libs in your project, then right-click your jar file and select "Add as a library" to use the jar package in your project. If the Libs directory has been copied to the project, if it is not found in Android Studio, you should switch to project files view, and then you will find all the files and folders. Right click to select Jar, click "Add as a library", complete!
dependencies {
Compile Filetree (dir: ' Libs ', include: [' *.jar '])
Compile files (' Libs/gson-2.2.4.jar ')
Compile files (' Libs/universal-image-loader-1.9.2.jar ')
}
Add a remote open Source Library
You can edit the Build.gradle file without downloading the Open source Library, entering your project (typically the app directory). Add dependencies in dependencies. As shown below
dependencies { compile ‘com.github.eluleci:flatui:3.0.0‘}
Add a local Open Source library
Download the open Source Library, place it in the same directory as the app directory, then edit the Setting.gradle file and add: ": Open Source Library folder name". For example, I placed the Image-loader Open Source Library folder in the app's sibling directory, and then edited the Setting.gradle and changed the contents to:
Include ': App ', ': Image-loader '
Then go back to the Build.gradle file in your app directory and add it under the dependencies {} node:
Compile project (': Image-loader ')
After that, you'll be able to reference the open source repository in your code (actually called Module).
Android Studio 1.1 uses introduction and import of jar packages and third-party dependent libraries