ubuntu12.04 install android sdk/ndk/Source compilation environment

Source: Internet
Author: User

Android has been done for nearly 5 years, during the various environments of Android have their own, they are a lot of ideas of people, their magic to the idea have, including blogging, but has been no concrete implementation ... More ideas, not to try to achieve also can only be ideas, today prepared from blogging this trivial start, hone their own to, not nonsense, directly into the theme:

A. JDK (download and install JDK), note the following:

a.32 bit needs under 32, 64 bit of also note is downloaded 64 bit;

B. Configure environment variables:

$ sudo gedit/etc/profile

At the end of the file, add the following:

Export Java_home= your JDK installation directory

Export JRE_HOME=${JAVA_HOME}/JRE

Export Classpath=.:${java_home}/lib:${jre_home}/lib

Export Path=${java_home}/bin:${jre_home}/bin: $PATH

C. Write the Ecport and then save the file, execute:

$ source /etc/profile

D. Test whether OK:

$ java-version

If similar Java version information appears, the basic OK:

Java Version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubunt u1~0.12.04.2)
OpenJDK 64-bit Server VM (build 24.51-b03, Mixed mode)

Two. Download the Eclispe SDK

1. Extract the Adb-bundle-linux version directly to http://developer.android.com/sdk/index.html to download the corresponding number of digits, including Eclipse + ADT +SDK in this package. I am a 64-bit version of the adt-bundle-linux-x86_64-20140321 that corresponds to the download.

2. Into the adt-bundle-linux-x86_64-20140321 extract directory, you can find 2 directories: Eclipse and SDK; go to eclipse and open eclipse to work.

3. Configuring the SDK environment (no requirement can be configured)

$ sudo gedit/etc/profile

at the end of the file, add the following:

Export Android_sdk_home= your SDK installation directory

export path=${android_sdk_home}/platform-tools:${ Android_sdk_home}/tools: $PATH

4. Save the file and execute:

$ source /etc/profile

5. Test environment:

ADB help information display after ADB input indicates OK;

$ DDMS Popup Ddms operation function means that the tools environment is OK;


three. NDK Environment:

1. Download the NDK corresponding version and unzip (I correspond to the android-ndk-r9d 64-bit); Download URL:

Http://developer.android.com/tools/sdk/ndk/index.html

2. Configure the Environment:

$ sudo gedit/etc/profile

at the end of the file, add the following:

Export Android_ndk_home= your NDK installation directory

export path=${android_ndk_home}: $PATH

3. Save the file and execute:

$ source /etc/profile

4. Test:

$ ndk-build OK if there is a build-related information hint;


Four. SOURCE Environment:

1. Installation requires a few tools and libraries:

$sudo apt-get Install Git-core GnuPG Flex Bison gperf build-essential Zip Curl Zlib1g-dev Libc6-dev Lib32ncurses5-dev IA 32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev gcc-multilib g++-multilib min Gw32 Tofrodos Python-markdown libxml2-utils Xsltproc


2. Download the source code:

Download repo, initialize download environment, repo configuration, Sync

       $ mkdir ~/bin  
       $ path=~/bin: $PATH  
       $  curl https:// dl-ssl.google.com/dl/ Googlesource/git-repo/repo > ~/bin/repo
        $ chmod a+x ~/bin/repo 
       $  mkdir ~/android/sources
       $ cd ~/android/sources
       $ repo init -u https:// android.googlesource.com/platform/manifest -b android-4.2.1_r1
       $ repo sync


3. Compile the code:

$ source Build/envsetup.sh
$ Lunch Full-eng
$ make-j4

The three commands here refer to the official documentation, which is explained in detail on the website:

Http://source.android.com/source/building.html


OK, it's basically OK to get here.





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.