Setting up the android work environment in Ubuntu

Source: Internet
Author: User
Tags gnupg

Reference http://source.android.com

 

1. Install JDK
Java 6: used to compile android2.3 and later versions:
Sudo add-Apt-repository "Deb http://archive.canonical.com/lucid partner"
Sudo add-Apt-repository "Deb-Src http://archive.canonical.com/ubuntu lucid partner"
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk
Java 5: used to compile android2.2 and earlier versions:
Sudo add-Apt-repository "Deb http://archive.ubuntu.com/ubuntu dapper main Multiverse"
Sudo add-Apt-repository "Deb http://archive.ubuntu.com/ubuntu dapper-Updates main Multiverse"
Sudo apt-Get update
Sudo apt-Get install sun-java5-jdk

The installation directory is in/usr/lib/JVM.

Select Java-1.5.0-sun
Sudo Update-Java-alternatives-s Java-1.5.0-sun
Select Java-6-sun
Sudo Update-Java-alternatives-s Java-6-sun

Use the following command to switch the Java-related command version:
Sudo Update-alternatives -- config Java
Sudo Update-alternatives -- config javac

2. Install androidCodeManage the GIT tool and install at least the following packages:
Sudo apt-Get install Git-core Git-SVN gitk Git-Gui Git-Email

3. Install the package required for Android Compilation
Software to be installed for 64-bit systems:
Sudo apt-Get install GnuPG flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev
The following software must be installed to compile the 64-bit operating system android2.2 and older versions:
Sudo apt-Get install gcc-multilib g ++-multilib libc6-i386 libc6-dev-i386
32-bit system compilation android2.2 and older versions:
Sudo apt-Get install GnuPG flex bison gperf build-essential zip curl zlib1g-dev libsdl-dev libesd0-dev libwxgtk2.6-devlibncurses5-dev

 

When compiling android2.2 and earlier versions, GCC and G ++ of version 4.4 may report an error, please direct the links of/usr/bin/GCC and/usr/bin/g ++ to version 4.3. The steps are generally as follows: first remove the existing link sudo RM/usr/bin/GCC, and then create a new link sudo ln-S/usr/bin/gcc-4.3/usr/bin/GCC, set the default g ++ version in the same step (install GCC and G ++: APT-Get install gcc-4.3 g ++-4.3 for 4.3)

4. Install the repo script

Download curl https://android.git.kernel.org/repo> ~ /Bin/Repo

Chmod A + x ~ /Repo

Add the repo path to the PATH variable.

Optional installation items. Installation Options may make your work more convenient:

5. download the official Android SDK toolkit, add the tools path to the PATH variable, and run tool/Android. First, check force HTTPS ...... on the settings interface ......, then download and install the SDK.

6. Install and set eclipse3.4 or 3.5 Based on the help documentation provided by the SDK, mainly to install the android plug-in for eclipse.

7. You can use gvim + cscope + taglist + lookupfile to read the code.

8. Download Android code from Google Official Website:

Repo init-u git: // android.git.kernel.org/platform/manifest.git download main line code configuration

Repo init-u git: // android.git.kernel.org/platform/manifest.git-B cupcake download cupcake branch code configuration

Repo sync downloads code based on the previously initialized repo configuration file

Only the code of a project, such as kernel/common, does not need to be Repo. You can directly use git.

Git clone git: // android.git.kernel.org/kernel/common.git

 

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.