Android Studio | How To Add A Library Project? - Truiton
Skip to content

Android Studio | How To Add A Library Project?

Android Studio Add Library

The new kid around the block is Android Studio. Its the new official IDE for Android development. Its a IntelliJ IDEA based IDE. Its a very flexible sort of an IDE, like most of the other java IDE’s. But since its a new development environment most of us don’t know how to do the most basic things in Android Studio. For example how to add a library in your project. As till now we have been working on Eclipse IDE.

How to import a library project in Android Studio?

In this short tutorial I would show you how to import a library project in Android Studio v1.2.1.1. The steps to do so are:

  1. Goto File -> New -> Import Module.
    Android Studio Add Library
  2. Source Directory -> Browse the project path.
  3. Specify the Module Name – it is used for internal project reference.
    Android Studio Add Library - 2
  4. Let Android Studio build the project.
  5. Open build.gradle (Module:app) file.
  6. Add the following line with your module name in place of “Volley” in the dependencies block:
    compile project(':Volley')
  7. It should look something like this:
    Android Studio Add Library 3
  8. After this Android Studio would start saying “gradle files have changed since last project sync”, press the “sync now” link to start a sync.
  9. That’s all you need to do.

This is how you add a library project to an Android app project in Android Studio. Now that you have learned how to add a library to your android app, Happy Coding. Don’t forget to like our Facebook and Google+ page for more updates like these.

7 thoughts on “Android Studio | How To Add A Library Project?”

  1. Thanks for the tutorial.

    However, importing a module only explains how to import the lib project into a given project, meaning that the imported files will reside under the project’s folder structure.

    How would you import the lib project as an independent project that could be shared among other projects?

    1. Same question for me. Why to make a library if you cannot share it between multiple apps ? I’m starting to believe that it is not possible to do that with Android studio.

  2. I Want to make my app in location news feed system for mobile users i want use modules in it im comfuse to how to make modules plz suggest me

Leave a Reply

Your email address will not be published. Required fields are marked *