1:17 PM
0


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.
android update project -p .
 
ant jar
You can find generated volley.jar in volley bin folder.


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
$ export ANDROID_HOME=/Applications/android-sdk-macosx
If you installed Android Studio, the value will need to be
export ANDROID_HOME=$HOME/Library/Android/sdk
Linux
$ export ANDROID_HOME=~/android-sdk-linux
Then add the paths to the platform-tools and tools sub-directories (Same on MacOS/Linux).
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
You should now be able to run android from the shell.

2. However running android update project -p . in the cloned volley folder throws this error:
Error: . is not a valid project (AndroidManifest.xml not found).
Please follow this commands:

$ git clone https://android.googlesource.com/platform/frameworks/volley
$ cd volley
$ git checkout 008e0cc8
$ android update project -p .
$ ant jar
Then, copy bin/volley.jar into your libs/ folder and off you go!

0 comments:

Post a Comment