Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create own gradle dependency library in Android Studio?

For developing android applications by using Android Studio, generally we used to add dependencies in build.gralde instead of adding jars or libraries. Example given below

compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.google.android.gms:play-services:9.2.1'

How to create my own gradle dependency library in Android Studio?

like image 425
sandeepmaaram Avatar asked Aug 11 '16 11:08

sandeepmaaram


2 Answers

I've already created my own library CustomSpinner and its Gradle's dependency is

dependencies {
    compile 'com.github.piotrek1543:CustomSpinner:0.1'
}

I'm pretty sure that this is what you're expecting.

I made it using Jitpack.io and following steps in that great Medium article:

Create and Distribute your own Android Library after reading this post!

I don't want copy-paste what was here already said, so please patiently read this article.

Hope it will help

like image 117
piotrek1543 Avatar answered Oct 19 '22 07:10

piotrek1543


You have to make your Android library (New project->Android library project), and upload it to bintray.

like image 43
Bandna Prasher Avatar answered Oct 19 '22 07:10

Bandna Prasher