Android Library Project Reference

My question may be very simple, but I cannot find the answer: For my Android project, I am trying to implement https://github.com/iPaulPro/aFileChooser In the installation instructions we find:

Add aFileChooser to your project as an Android Library Project.

      

with a link to http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject When I follow the link point 1:

 1. Make sure that both the project library and the application project 
 that depends on it are in your workspace. 
 If one of the projects is missing, import it into your workspace.

      

How should I do it? zip aFileChooser to the main folder, or do I need to right click on the application and create a new package or something?

Note: im using android studio and following the tutorial in comments, but android studio dosnt recognizes the project as a library. I got the project from github by downloading the zip.

+3


source to share


2 answers


1 - A new folder is created in the root directory of your project (where res, java and AndroidManifest.xml file is located):

/ LIBS



2- Insert your library into the newly created one

/ LIBS



folder. Now just download the ZIP from Github, rename the library directory to "aFileChooser" and copy it over.

3 - In the app /build.gradle add the library project as a dependency:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile project(":aFileChooser")
}

      

+3


source


To solve this problem:



  • Download and unzip the library
  • In your project go to file-> new -> import module -> click on the little button on the right and select the library you downloaded -> ok NOTE. There are 2 FOLDERS in "aFileChooser-master": aFileChooser AND aFileChooserExample. YOU MUST CHOOSE aFileChooser
  • Now go to file -> project structure -> select "application" tab on the left -> select "dependencies" tab -> click "plus" button -> select module dependencies -> select library -> ok
  • Done. Now you can use the library classes in your project.
-1


source







All Articles