Obtain the android source code
Where is the source code?
You can access the andorid source code repository through http://android.git.kernel.org.
The source code is about 2.1 GB. You need 6 GB of space to build the entire source code.
Build a PC Build Environment
Linux (Ubuntu is recommended)
Required software packages for Ubuntu Linux 32-bit x86 machine:
. Git 1.5.4 or newer
. Jdk5.0/jdk6.0 (in fact, both versions can be used currently. Check the build/CORE/Main. mk file)
. Flex, Bison, gperf, libsdl-Dev, libesd0-dev, libwxgtk2.6-Dev (optional), build-essential, zip, curl
Sudo apt-Get install Git-core GnuPG sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
You may need to install valgrind to monitor memory leakage: sudo apt-Get install valgrind
Ubuntu 8.10 users may need to install the libreadline New Version: sudo apt-Get install lib32readline5-dev
Install Repo
Repo is a script used to manage the android source code based on the GIT tool.
Install repo:
$ Cd ~
$ Mkdir Bin
$ Echo $ path
$ Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
$ Chmod A + x ~ /Bin/Repo
Initialize the repo client (that is, download the latest Android source code)
$ Mkdir mydroid
$ CD mydroid
$ Repo init-u git: // android.git.kernel.org/platform/manifest.git
Or
$ Repo init-u git: // android.git.kernel.org/platform/manifest.git-B froyo (get froyo Branch)
$ Repo sync
Repo will prompt you to enter your name and mail address. If you want to submit your code, you 'd better enter a mail associated with your Google account.
What is the manifest file? Because there are many repositories and branches of the android source code, the manifest file is a guiding file for synchronizing the android source code to your local machine, it tells you which repositories or branches are remotely obtained based on the source code of your specified branch.