How to setup the build enviroment and download the source code of Android on Ubuntu 10.04

I will describe about the method to setup the build environment of Android. Also about the download the source code.
How to setup the build environment for Aandroid
1. Install the package
1) You need to install the program the list below
Program list : samba, ssh, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl,
git-core, gnupg, gcc-multilib, libx11-dev, x11proto-core-dev,
valgrind, openjdk-6-jdk
(Use the command : sudo apt-get install samba ssh
flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
git-core gnupg gcc-multilib libx11-dev x11proto-core-dev
valgrind openjdk-6-jdk
2. Modify some files
1) Add source list to "/etc/apt/sources.list"
Source List :
deb http://kr.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://kr.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
2) Add the path of JAVA to ".bashrc"
For example, export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk/
export ANDROID_JAVA_HOME=$JAVA_HOME
3. Enable the ".bashrc" and package update and upgrade
1) Execute the command below
Command : (1) source ~/.bashrc
(2) sudo apt-get update
(3) sudo apt-get upgrade
Until now I mention about the 3 steps for setup the build environment for android. I guess you have no problem to setup the build environment. I knew when you try to install the package some of things can not be success but you can find similar thing so please try to find it if you can not install the packsge.
How to download the Android source code
1. Download the repo script
1) Use the command and download the repo script
(Before download the script you must make the bin folder in your home folder)
Command : (1) curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
(2) chmod a+x ~/bin/repo
2. Download the source code
1) Init the repo and sync
(Before download the source code you must make the folder to download the source code)
Command : (1) repo init -u https://android.googlesource.com/platform/manifest
(2) repo sync
If you success to init the repo using the command (1), you got request to register your name and e-mail address if not you are on fail so you need to check the error and try it again.
If you success in (1), you ready to download the source code using the (2).
3. How to build the source code
I didn't try yet in my local pc so I'm not sure yet how to build but I knew if you download the source code using repo there cross compiler so you just can build it.
Command : (1) source build/envsetup.sh
(2) make
I will update soon about the build.
Thanks to read this documents. This is very simple document to setup the build environment, download the source code and build method. I wish it can help you understand and solve your problem.
Written by Donghyeon Kim
hyeonykim@gmail.com
2012.10.3