FunctionallyReactive
FunctionallyReactive

Reputation: 579

How to import a Library Project?

I am interested in including an Android Library project into studio. I get that its just a simple gradle change :mylibrary in the compile directive, but how do I pull this library code into studio? I want to see the library and also my app in the same Studio window. I don't see an import library option. I see open project but then it seems to want to open new window etc. How do I just import the damn library project?

Update, just wasted a half hour: Hey Studio team guys, why are you hiding this under File ->New ? What on earth does importing a library have to do with File and New?

Upvotes: 0

Views: 156

Answers (2)

With you project currently loaded at Android Studio, use the menu File - Project Structure - Modules - Dependencies

Upvotes: 2

Shvet
Shvet

Reputation: 1201

In Android studio we can use 3 types of libraries.

  • Gradle which is easiest way to add,
  • File which is called jar file,
  • Module library which is another android studio project which is defined as a library in gradle.

To Add Gradle library you need to add gradle url in build.gradle at module level.

Gradle

To Add File dependency/library you need to add jar file into your project's lib folder and add it as a library.

File Library

As the most Module library can be add by importing another project as a module and set it as a library.

Module Dependency

How to add all this as a library?

You can go to Project Structure to add file and module as a library. on your project module (say app in my project) click F12(For windows OS) and you will get project structure. You can add libraries from dependency tab.

Project Structure

Upvotes: 0

Related Questions