Why is there no jar for volley(android)? - android

I use Volley, like others, as networking library in my projects. So in most tutorials, guidelines suggest to clone the project and follow the boilerplate steps to build the project.
Does anybody have any idea, why Google has not built the project into a ready-made Jar file, in order to ease the way?

In order to use Volley in your application, you can use a couple of solutions:
Add following dependency to your app's build.gradle file (according to Android the easiest way):
dependencies {
compile 'com.android.volley:volley:1.1.0'
}
Cloning the Github repository and then set as a library. For a complete description please refer to Android developer.
git clone https://github.com/google/volley

If you are using gradle in Android Studio Volley can be added with one line to the gradle.build file's dependencies.
dependencies {
compile 'com.mcxiaoke.volley:library:1.0.+'
}
If you are using Eclipse, Volley can be added as a library project which will save you having to create a jar.

If you use git, you can add the volley library project as a submodule by using 'git submodule add'
https://android.googlesource.com/platform/frameworks/volley/

Related

How to add a github library to my android project?

I would like to add this library so that I can use it on my android project but I can't figure out how to. I get that I'm supposed to clone it but it doesn't say into which directory I should clone it. I'm also not sure if I should use ant or maven, what those are, and how to do that. Any help would be appreciated.
This is the project I'm hoping to add it to:
https://github.com/mikeoles/swiftset
One more project i which is forked from bauerca/drag-sort-listview
is available for drag-sort-listview and dependency of that project is deployed on maven repository
https://github.com/ened/drag-sort-listview
Gradle is available on mvn repository. check this URL
https://mvnrepository.com/artifact/asia.ivity.android/drag-sort-listview/1.0
Add this to your android project
compile group: 'asia.ivity.android', name: 'drag-sort-listview', version: '1.0'
this project is not a library project instead it is an Android app project so what you have to do is to clone the repo https://github.com/mikeoles/SwiftSet.git and open this as an existing Android project.
FYI, you can check android project structure at this link https://developer.android.com/studio/projects/.
You can make the library support gradle. Or copy code to you project(the project has no update in last 5 years).

How to import github library in eclipse

I am trying to use material designing library https://github.com/drakeet/MaterialDialog from github in my eclipse but I didnt found any jar file in this library project. So how can I use this library in my project in eclipse
If you have a Gradle build, as mentioned in the README, you just add:
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}
As explained in the blog post, this looks like (in Android Studio)
You have to convert this library project from gradle to eclipse. You can get many links over the web for it. Try this.
The library project you are looking is build into android studio(Gradle). So I recommend you to use android studio instead of eclipse.
I recommend you to use Android Studio with Gradle support by default. But if you want use Eclipse download Gradle plugin and add this lib as dependency
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}

Android Picasso cloned but can't run the sample project, no gradle files found

I have cloned the Square/Picasso Github repo, however, I did not find any Gradle files and therefore I am still stuck figuring out how to use the library and run the sample app as well. I want to use the code instead of the jar because I have few modifications I need in the library to use it.
Following up from my comments in your question, if you want to use picasso with your changes, what you'll need to do is clone picasso, make your changes to the source, then run a Maven package task, if you have Maven:
mvn clean package -Dmaven.test.skip=true
If the build is successful, you will find your .jar file to use as a library, with all your changes, in directory picasso/target.
I assume you're using Android Studio. Inside your build.gradle file, there is a dependencies section. Simply add the following to the list of dependencies
compile 'com.squareup.picasso:picasso:2.5.2'
And then sync your project. The Picasso library will be added to your project.
As Bidhan points out, in the Readme file you can find the info
Using Gradle:
compile 'com.squareup.picasso:picasso:2.5.2'
or Maven:
<dependency>
<groupId>com.squareup.picasso</groupId>
<artifactId>picasso</artifactId>
<version>2.5.2</version>
</dependency>
Add this in your build.gradle dependencies section:
compile 'com.squareup.picasso:picasso:2.5.1'

how do you clone a project from github into the same project

In android studio how do you git clone a project from github into the same project?
If I got your question correctly, you want to check out some library and add it as a dependency to your (gradle based?) project.
The prefered way would be to checkout it separately and built it as a library project. And if you have maven you can then install it to your local repository.
The other way (and probably what are you trying to achieve) is to add it as a submodule of your local repository.
git submodule add git://repourl.git yourSubmoduleFolder
Then you can add this library as a module dependency to your application module. (You don't have to use git submodules, you can always just get the repo as a zip and extract it into your project)
If you put your library under libraries folder in your project then you can do it like this.
Add this to your settings.gradle
include ':libraries:yourLibraryModuleName'
Add this to your build.gradle
dependencies {
compile project(':libraries:yourLibraryModuleName')
}
You should now be able to build your application with the submodule
Please note that this was just a quick answer, you can find more info on both gradle submodules and gradle module dependencies here on StackOverflow. I guess this should be enough to point you in a right direction.
It does not. However it's a good practice to put it in libraries or libs,...folder

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
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
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.).

Categories

Resources