For Android 2.2Compilation in Ubuntu is the content to be introduced in this article, mainly to understand and learnFor Android 2.2The compiled content.For Android 2.2For more information about compilation, see this article.
1. Download the Android 2.2 source code
The git version control library is used to download the android source code. For details about git, see Wikipedia.
- http://zh.wikipedia.org/wiki/Git
(1) install git and curl
- sudo apt-get install git-core curl
(2) install the repo script
- curl http://android.git.kernel.org/repo >~/repo
(3) Give repo executable permissions
- chmod a+x ~/repo
(4) create a directory named mydroid and enter the directory.
- mkdir mydroidcd mydroid
(5) initialize the version Library (-B indicates a Branch)
- /repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
Then, the system prompts you to enter your name and email address.
(6) repo Synchronization
- /repo sync
Finally, you can see the Syncing work tree: 100%. It takes a long time to download the code.
2. install java sdk1.5
(1) Because sdk1.6 is in the source, we need to download the binfile from oracle for installation.
- http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html
Download the latest update 22 version in MySQL 1.5
Since I mounted the binfile to the directory of/usr/java (the java folder is built by myself), we need to get the root in each of the following steps. Next time, it will not be so troublesome, it is better to directly load the user directory, so you do not need to modify the profile file. bashrc.
(2) Add the executable permission to the binfile and install it.
- sudo chmod +x jdk-1_5_0_22-linux-i586.bin
- sudo ./jdk-1_5_0_22-linux-i586.bin
(3) set the environment variable in Android 2.2. Because it is installed in the/usr/java directory, I tried to modify it only. the bashrc file is useless, because after eclipse is started, it still prompts that the java environment is not found, so you need to modify the profile file and add the following code at the end of the/etc/profile file.
- #set java environment
- exportJAVA_HOME=/usr/bin/jdk
- export JRE_HOME=$JAVA_HOME/jre
- export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
- export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
(4) Effective
- sudo source /etc/profile
In this way, jdk1.5 is installed. Enter java-version in the console and the following information will appear:
- java version "1.5.0_22"
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
- Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)
This indicates that the configuration is successfully installed.
3. Compile android 2.2
(1) Make sure that the following tools are installed before compilation.
- sudo apt-get install build-essential
- sudo apt-get install texinfo
- sudo apt-get install libncurses-dev
- sudo apt-get install flex bison libsdl-dev libwxgtk2.6-dev valgrind
(2) After installation, go to the Android 2.2 directory and run the following command:
- make
Make will take a long time and be patient
My machine is 64-bit, but the 32-bit operating system is installed, there is no such problem as the lack of 64-bit packets on the Internet.
4. eclipse,For Android 2.2Sdk Configuration
(1) The eclipse version I use is 3.5.2 ,:
- http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/download.php?dropFile=eclipse-SDK-3.5.2-linux-gtk.tar.gz
(2) download and install ADT ,:
- http://developer.android.com/sdk/eclipse-adt.html
Use the latest ADT. The old ADT version is downloaded before, and the result configuration is as follows:For Android 2.2When the sdk appears, cocould not find SDK_Root \ tools \ adb.exe! So it is best to use the latest ADT
(3) download and install the android sdk ,:
- http://developer.android.com/sdk/index.html
The sdk is not the full version. After downloading the Google installation package, you must use it to continue downloading the complete installation package.
After the above configuration is installed with ADT, go to the tools directory of the android sdk and execute:
- android
Then you can select the sdk version for installation.
Finally, configure the android sdk environment to open the. bashrc file.
- #set the android_adb environment
- export ANDROID_SDK=/home/sanjinxiong/developmentTools/android-sdk-linux_x86
- export PATH=$ANDROID_SDK/platform-tools:$PATH
In this way, the entire configuration process is over, and the configuration process is still relatively long.
Summary:For Android 2.2The compilation details in Ubuntu are described.For Android 2.2Compilation content learning can be helpful to you!