I'm working on Android Library project and want to add Picasso to my library. I've noticed that different libraries use different approaches to do this:
So the question: what's the best way to add third party libraries to the Android library project? I mean the way that would help to simplify library integration process for the end-user and to avoid versions conflict and other potential issues. What are the advantages and disadvantages of a particular approach?
Most of the time you don't really have a choice, you will have to follow the library installation recommendations.
If all options are available I think IMHO that it is much easier with Gradle or Maven since the only thing you have to do is generally adding one line into your configuration file to setup a new library.
When an update is available, you change the version and the system will automatically download and update the library for you.
When you have to use static libraries, you need to setup all by yourself and link the external library to your project. Now I keep only static libraries if I have to customize some code in it.
I am not an expert on the subject but since I migrated to Android Studio, Gradle saved me a lot of time (I was using Eclipse ADT before and never succeeded to integrate Gradle on it).
You can also directly compile your external jar files on Gradle by using:
compile fileTree(dir: 'libs', include: ['*.jar'])
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