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.
I copied it to the app/libs
folder, and then in build.gradle
I add
sourceSets {
main.java.srcDirs += 'libs/GFMinimalNotifications/src/main/java'
}
To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.
Go to Android Studio and navigate to File -> New -> Import Module -> Select the library path -> Finish.
Import a module To import an existing module into your project, proceed as follows: Click File > New > Import Module. In the Source directory box, type or select the directory of the module(s) that you want to import: If you are importing one module, indicate its root directory.
How to find the libs folder in Android Studio? If you are unable to find the libs folder in Android studio then open your android project in “Project” mode If the project is already opened in the “Android” mode. Then go to Your Project Name > app > libs and right-click on it and paste the downloaded JAR files.
Steps to add modules in Android Studio download zip file & follow steps
copy in project full package library
in settings gradle add include ':library',':app'
in build.gradle
dependencies {
...
compile project(':library')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With