To get started with Android, you'll need to get familiar with Git and Repo.
To initialize your local repository using the AOSP trees, use a command like this:
repo init -u git://github.com/AOSP-JF/platform_manifest.git -b aosp-5.1
Then to sync up:
repo sync
To build, just use a command like this:
. build.sh
Then choose an option between 1, 2 or 3