Search code examples
androidandroid-activityandroid-library

Adding Library Source into Android Studio


I am sorry for asking this newbie question.

I am trying to use this library in my project: https://github.com/gfranks/GFMinimalNotifications

I would like to import the source codes and not the binary.

The github page says Simply copy the source/resource files from the library folder into your project.

So I tried to drag and drop these two files directly to my libs folder in Android Studio.

And I went back to my Activity and try to use it in my code. But the autocomplete does not seem to recognize the library.

Any help, please? After I copied into my libs folder.

Importing the whole module seems to be wasteful considering the project has many assets that are irrelevant to the library itself.

Found the solution

I copied it to the app/libs folder, and then in build.gradle I add

sourceSets {
    main.java.srcDirs += 'libs/GFMinimalNotifications/src/main/java'
}

Solution

  • Steps to add modules in Android Studio download zip file & follow steps

    Follow Step first

    Step second Step third Step fourth