Search code examples
androidmavenandroid-studiogradlematerialdrawer

How to build androidstudio projects with 3rd party libraries


I am new to android. I wish to use https://github.com/mikepenz/MaterialDrawer navigation drawer project's library. It is provided with a dependency.

The MaterialDrawer Library is pushed to Maven Central, so you just need to add the following dependency to your build.gradle.

compile('com.mikepenz:materialdrawer:3.1.2@aar') {
        transitive = true
    }

There are 2 files in Gradle Scripts folder of my android studio project

  1. build.gradle (Module :app)

  2. build.gradle (Project : AndroidAppName)

In which folder , i should enter these dependency code ? Could you please explain the procedure of compilation/build of an android studio project.

Thanks in advance


Solution

  • The website says:

    The MaterialDrawer Library is pushed to Maven Central, so you just need to add the following dependency to your build.gradle.

    compile('com.mikepenz:materialdrawer:3.1.2@aar') {
        transitive = true
    }
    

    So, all what you have to do is open your build.gradle file inside app folder and the following line inside here:

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