We will start with installing tools required to clone and build volley project. For this we need git (to clone the project) and ant (to build) tools.
1.1 Installing Git
Git software is used to clone git projects into your local workspace. Download & install git, once installed run git command in terminal just to make sure that it is accessible via command line. If you are getting git command not found error, add the git installation directory to environmental variables.
1.2 Installing apache ant
Apache ant is a command-line tool used to build the source code. Download ant from https://ant.apache.org/bindownload.cgi and add the bin path to environmental variables. You should able to execute ant command too in terminal.
1.3 Cloning volley library
Open command prompt, navigate to a location where you want to clone volley and execute following command. This will download a copy of volley library into your local drive.
git clone https://android.googlesource.com/platform/frameworks/volley
1.4 Making volley.jar
You can use the volley as a library project to your main project or you can simply generate volley.jar and paste it in project libs folder. To generate volley.jar, move into volley dir (cd volley) and execute below commands.
You can find generated volley.jar in volley bin folder.
android update project -p .
ant jar
For more information: http://developer.android.com/training/volley/index.html
Resolve error:
1. Getting a
android:command not found error.
android update project --path .
On MacOS/Linux, define the path to wherever you installed your SDK as
ANDROID_HOME
:MacOS
If you installed Android Studio, the value will need to be$ export ANDROID_HOME=/Applications/android-sdk-macosx
Linuxexport ANDROID_HOME=$HOME/Library/Android/sdk
Then add the paths to the$ export ANDROID_HOME=~/android-sdk-linux
platform-tools
and tools
sub-directories (Same on MacOS/Linux).You should now be able to runexport PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/platform-tools:$PATH
android
from the shell.2. However running
android update project -p .
in the cloned volley
folder throws this error:
Please follow this commands:Error: . is not a valid project (AndroidManifest.xml not found).
Then, copy$ git clone https://android.googlesource.com/platform/frameworks/volley $ cd volley $ git checkout 008e0cc8 $ android update project -p . $ ant jar
bin/volley.jar
into your libs/
folder and off you go!
0 comments:
Post a Comment