Previously developed android are used by Eclipse, recently due to the development of an application with foreign friend Timothy, he was just switching from WP platform using Android, using the development environment when Android Studio, in order to facilitate project communication, I was trying to use Android Studio. Just started with a question: How do I import a third-party library in Android studio?
First I use the studio version of 0.5.8, try to solve the following, in two ways:
1. Importing the JAR Package
Directly copy your jar package (such as Actiobarsherlock.jar) to the project's Libs directory, then right-click the jar file and select Add as Library...,ok.
2. Importing library Project (more hassle)
Try to follow the methods in Http://www.cnblogs.com/neozhu/p/3458759.html, not successful (too much to modify, too cumbersome), and then find such a method on StackOverflow:
The new Android library replaces files for
2.1 Select File->new module->android Library, click Next, fill in the app name (such as Notesshare) and Module name (such as the third-party library inscription I quoted), Same as your third-party library name);
2.2 Delete all files in the Src/main directory in the library directory;
2.3 Copy the Androidmainfest.xml, res, src files (clips) of the third-party library to the Src/main directory of the library directory;
2.4 Rename the SRC directory under the Src/main directory (SHIFT+F6) to Java;
2.5 Delete the dependencies and release modules in the library directory (inscription directory) under the Build.gradle file (note Do not modify the wrong place);
2.6 Add the template to your project: File->project Structure, you can see the left modules a column more than your project (Notesshare) outside of a module (inscription), click on your own engineering module, To switch to the Dependencies tab, click the "+" icon in the top right corner and three options appear (1. Library Dependency 2.File Dependency 3.Module denpendency), keyboard key 3 selection, then the Dependencies tab will show the Libraries module.