coder
coder

Reputation: 10520

add library from Git to Android Studio

I know this must be a pretty basic question, but I'm new to Android Studio and gradle, and I can't find any up-to-date info on this.

I'm trying to add this library to my project: android-segmented-control.

It doesn't look like I can add it to my build.gradle file (correct?). I'd like to do it that way, of course, and not download the project if possible.

If I do need to download the project, how do I link it up with my existing project? Again, I haven't been able to find anything that is current that describes this process for Android Studio 0.5.3

Upvotes: 0

Views: 220

Answers (2)

hoang8f
hoang8f

Reputation: 63

Thanks @Thomas Bouron for the hint !
I have pushed my library to maven center, so you just need to add the following dependency to your build.gradle.

dependencies {
    compile 'info.hoang8f:android-segmented:1.0.0'
}

(A little late for @workInAFishBowl but it may be helpful for others.).

Upvotes: 1

Thomas Bouron
Thomas Bouron

Reputation: 613

The library you mentioned does not seems to be pushed on maven central or any other maven repository. As this library contains resources files, you cannot add it as a jar.

The only way to use it is clone the git repository and add it as a module to your android app project.

Meanwhile, you can ask the author to make it available on a Maven repository like OSS sonatype

Upvotes: 2

Related Questions