How to compile Android 2.2 In Ubuntu

Source: Internet
Author: User

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.

 
 
  1. http://zh.wikipedia.org/wiki/Git 

(1) install git and curl

 
 
  1. sudo apt-get install git-core curl  

(2) install the repo script

 
 
  1. curl http://android.git.kernel.org/repo >~/repo  

(3) Give repo executable permissions

 
 
  1. chmod a+x ~/repo  

(4) create a directory named mydroid and enter the directory.

 
 
  1. mkdir mydroidcd mydroid  

(5) initialize the version Library (-B indicates a Branch)

 
 
  1. /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

 
 
  1. /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.

 
 
  1. 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.

 
 
  1. sudo chmod +x jdk-1_5_0_22-linux-i586.bin    
  2. 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.

 
 
  1. #set java environment    
  2. exportJAVA_HOME=/usr/bin/jdk    
  3. export JRE_HOME=$JAVA_HOME/jre    
  4. export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH    
  5. export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH  

(4) Effective

 
 
  1. sudo source /etc/profile  

In this way, jdk1.5 is installed. Enter java-version in the console and the following information will appear:

 
 
  1. java version "1.5.0_22"  
  2. Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)  
  3. 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.

 
 
  1. sudo apt-get install build-essential    
  2. sudo apt-get install texinfo    
  3. sudo apt-get install libncurses-dev    
  4. 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:

 
 
  1. 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 ,:

 
 
  1. 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 ,:

 
 
  1. 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 ,:

 
 
  1. 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:

 
 
  1. android  

Then you can select the sdk version for installation.

Finally, configure the android sdk environment to open the. bashrc file.

 
 
  1. #set the android_adb environment    
  2. export ANDROID_SDK=/home/sanjinxiong/developmentTools/android-sdk-linux_x86    
  3. 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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.