Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio + Volley [duplicate]

I'm new to Android Studio and I want to use Volley library for my app but i can't add the source as a library in Android Studio.

I've searched the web but couldn't find anything. Everywhere is said to import as a library but I don't know how.

I got the volley source from git repository:

https://android.googlesource.com/platform/frameworks/volley

But I don't know how to add it to my project as a library.

like image 768
Jilberta Avatar asked Aug 29 '13 14:08

Jilberta


2 Answers

UPDATE: Volley is now official and is available through the JCenter. Here's how to import it:

implementation 'com.android.volley:volley:1.1.1'

DEPRICATED WAY:

Late to the party, but was able to import it by adding this to the build.gradle file:

dependencies {
    compile 'com.mcxiaoke.volley:library:1.0.19'
}

Here is the link to unofficial Maven repo

NOTE: Volley v1.0.19 is current as of 02/05/2016. Please go to the Maven Repo (use link above), look up the latest version (line where artifactId = library) and update the version in your gradle configuration accordingly.

like image 121
C0D3LIC1OU5 Avatar answered Nov 13 '22 16:11

C0D3LIC1OU5


If you don't want to import it as a module but simply use it as a dependency you can create a jar using ant. In your volley directory just type ant jar and you will find a volley.jar in YOUR_VOLLEY_DIRECTORY/bin (you need to install apache ant if you don't have it)

You can copy the jar in the libs directory in your android app project (or create a libs directory if you don't have one) and add the dependency to build.gradle like this

compile files('libs/volley.jar')
like image 23
alex Avatar answered Nov 13 '22 16:11

alex