I wanna use the google\'s volley library
I am using Android Studio and I know how to add .jar libraries.
But I could not create a .jar library with the voll
Updating Warpzit's answer for Android Studio 1.3.2 (differences in bold)
(update: appears to be the same for Android 2.0)
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")
The "compile project(':volley')" line was giving me this error:
Error:Execution failed for task ':volley:processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt
It was caused because the compileSdk and buildTools versions of module volley were currently on"22" and "22.0.1" and I my project was working with newer ones ("24" and "24.0.1").
SOLUTION:
Open your build.gradle (Module:volley) file and change the version of "compileSdk" and "buildTools", for example I changed this:
android {
compileSdkVersion 22
buildToolsVersion = '22.0.1'
}
for this:
android {
compileSdkVersion 24
buildToolsVersion = '24.0.1'
}
You should no longer have this error, I hope it helps:)
add volly to your studio gradle app by compile 'com.android.volley:volley:1.0.0'
Add this line to the dependencies in build.gradle:
compile 'com.mcxiaoke.volley:library:1.0.+'
To add volley as submodule and getting regular updates from the GIT repo the following steps can be followed. Main advantage is, Volley can be customised and source code could be pull from GIT repo whenever update is required.
It is also helping for debugging purpose.
Follow the below steps :
Step I :
Add volley as submodule in Android application project GIT Repo. git submodule add -b master https://android.googlesource.com/platform/frameworks/volley Libraries/Volley
Step II :
In settings.gradle, add the following to add volley as a studio project module. include ':Volley' project(':Volley').projectDir=new File('../Libraries/Volley')
Step III :
In app/build.gradle, add following line to compile Volley compile project(':Volley')
That would be all! Volley has been successfully added in the project.
Every time you want to get the latest code from Google official Volley's repo, just run the below command
git submodule foreach git pull
For more detailed information : https://gitsubmoduleasandroidtudiomodule.blogspot.in/
GIT Repo sample code : https://github.com/arpitratan/AndroidGitSubmoduleAsModule