Import Android volley to Android Studio
Solution 1:
Volley is now officially available on JCenter:
Add this line to your gradle dependencies for your Android project's app module:
implementation 'com.android.volley:volley:1.1.1'
Solution 2:
So Volley has been updated to Android studio build style which makes it harder create a jar. But the recommended way for eclipse was using it as a library project and this goes for android studio as well, but when working in android studio we call this a module. So here is a guide to how do it the way Google wants us to do it. Guide is based on this nice tutorial.
-
First get latest volley with git (git clone https://android.googlesource.com/platform/frameworks/volley).
-
In your current project (android studio) click
[File]
-->[New]
-->[Import Module]
. -
Now select the directory where you downloaded Volley to.
-
Now Android studio might guide you to do the rest but continue guide to verify that everything works correct
-
Open settings.gradle (find in root) and add (or verify this is included):
include ':app', ':volley'
-
Now go to your build.gradle in your project and add the dependency:
compile project(":volley")
Thats all there is to it, much simpler and easier than compiling a jar and safer than relying on third parties jars or maven uploads.
Solution 3:
Updating Warpzit's answer for Android Studio 1.3.2 (differences in bold)
(update: appears to be the same for Android 2.0)
- First get latest volley with git.
- In your current project (android studio) click [file] --> [New]--> [New Module].
- Now select [Import Gradle Project], Click Next
- Now select the directory where you downloaded Volley to.
- Now Android studio might guide you to do the rest but continue guide to verify that everything works correct
-
Open settings.gradle (find in root) and add (or verify this is included):
include ':app', ':volley'
-
Now go to your build.gradle in your project and add the dependency:
compile project(":volley")
Solution 4:
Way too complicated guys. Just include it in your gradle dependencies:
dependencies {
...
compile 'com.mcxiaoke.volley:library:1.0.17'
}