1. Install JDK first:
Sudo add-Apt-repository "Deb http://us.archive.ubuntu.com/ubuntu/ hard Multiverse"
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk
After completing these three steps, we can use Java-version to check whether the installation is successful. If JDK is available, you do not need to install it.
2. Download the source code:
First, create your own working directory: (my files are/xluo/work/android_dev /)
Install the compilation tool
Sudo apt-Get install Git-core GnuPG flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libz-dev libgl1-mesa-dev
Install repo management tools
Curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~ /Xluo/work/android_dev/bin/Repo
Change the repo file permissions after CD bin:
Chmod A + x Repo
Cd ~ /Xluo/work/android_dev/
Prepare to download the source code:
./Bin/repo init-u
Https://android.googlesource.com/platform/manifest
Next, follow the prompts to complete the compilation.
References: http://www.2cto.com/kf/201202/118141.html