Android Studio is a new and powerful official IDE for android development. Android Studio is IntelliJ IDEA based IDE. There are lots of open source libraries available to make android application awesome and almost all new android developer those whose use AndroidStudio development environment search for how to add a library project to the Android Studio. So, in this article you will learn to add a library project to android studio and run it.

In this example, I have used FButton (a flat button library for android) library to show how to add library project in android studio.

Android Material Design with Design Support Library
Best Android Tabs Libraries Collection
Best Navigation Drawer Libraries for Android Project

How to Add a Library Project to Android Studio

Following are the simple steps to add library project in your android studio project.

1. Create a new Android Project

Let’s start by creating new android studio project with following information.

Application Name: Add Library Project Android Studio
Company Domain: viralandroid.com
Package Name: com.viralandroid.addlibraryprojectandroidstudio
Minimum SDK: Android 3.0 (API 11)

2. Download Library Project

I have used FBbutton library in this example you can download it from GitHub. After downloading FBbutton zip file extract it and find library folder inside it. And then rename library to FBbutton.

3. Adding Library Project to AndroidStudio

Open Add Library Project Android Studio project that we have created before and copy and paste FBbutton file in AddLibraryProjectAndroidStudio/app/libs/ from your android studio like below screenshot.
Android Studio Library Project Directory

3. Adding Dependencies

To make working you have to add FBbutton library project dependencies in your android studio project build.gradle file like this.

4. Adding FBbutton in XML Layout File

Following is the modified content of XML layout file.

And following is the default content of Java activity file.

How to Add a Library Project to Android Studio

That’s all. Now you can add any library project to android studio like this. If you have any question/problem you can mention below in the comment box.

Post a Comment

Powered by Blogger.