CentOS Linux System Build Android Development environment detailed introduction _linux

Source: Internet
Author: User
Tags centos

CentOS Linux system to build Android development environment detailed introduction

Many people are under the windows of Android development, but for the linux,android development environment of less information, today on the Internet to find a user to share in the CentOS Linux system to build the Android development environment process. The following is the detailed procedure for the configuration described in the original:

Since I've been using CentOS 5.5 a day recently, I chose CentOS5.5 as my development environment.

The main steps include the following:

1, JDK Installation
2. Eclipse Installation
3, ADT Installation
4, Android SDK installation
5, Android NDK installation

1, JDK Installation

Did not choose CentOS's own Java environment, download Oracle Latest version of Java, download address for

Http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html

Direct download, then jump page select Platform Linux download, I did not register, Direct point continue to go to the next page, select the type of package you want to download, I choose

Jdk-6u21-linux-i586-rpm.bin the speed of the Internet quickly, then it will be over.

Modify executable permissions when download is complete:

#chmod +x Jdk-6u21-linux-i586-rpm.bin

And then execute it:

#./jdk-6u1-linux-i586-rpm.bin

There may be some choices in the process, direct yes.

Configure environment variables after installation is installed by default to the/usr/java below.

Note: When there are multiple items, Windows is separated by semicolons, but the colon is used under Linux:.

#vim/etc/profile

Add the following on the last side of the file:

 Export java_home=/usr/java/jdk1.6.0_21 export 
  java_bin=/usr/java/jdk1.6.0_21/bin 
  export path= $PATH: $JAVA _ Home/bin 
  export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar 
  export java_home java_bin PATH CLASSPATH

View the Java version after completion:

 #java-version

  Java (tm) SE Runtime Environment (build 1.6.0_21-b06) 
  Java HotSpot (tm) Server VM (build 17.0-b16, MI Xed mode) 

The Java environment is configured to continue with the installation Ide,google recommended eclipse.

2. Eclipse Installation

I'm new, too. Of course it's all up to date, Eclipse also downloads the latest version of Eclipse (Helios Edition).

Eclipse Download: http://www.eclipse.org/downloads/

Eclipse IDE for Java developers, MB Linux Bit

People who have experience in Java usage Development know that Eclipse is a green version and can be used for decompression. Double-click the eclipse file in the Eclipse folder after the decompression completes to run the Eclipse IDE for Java dvelopers. Very familiar with it, set the workspace, the following is welcome to turn off the interface into the development environment.

I put eclipse under the/home/android/, and then I put everything I needed under it.

3, ADT Installation

ADT version: ADT 0.9.7 (May) Android development tool

(1) Use Eclipse's upgrade manager to install ADT:

1. Start eclipse and go to help > Install New Software.

2. In the Available Software dialog box, click Add ...

3. The Add Site dialog box appears, enter a name (for example, "Android Plugin") in the Name field, and enter Url:https://dl-ssl.google.com/android/in the "Location" field eclipse/.

4. Note: If there is a problem, you can change HTTPS to HTTP to try. Click OK.

5. Back to available software interface, you should see "Developer Tools". Select the checkbox. Click Next, accept license Agreement, and then click Finish.

6. Restart Eclipse.

(2) manual installation ADT, download ADT.

ADT 0.9.7 http://dl.google.com/android/ADT-0.9.7.zip

After the download is complete, unzip the corresponding file and copy it to the corresponding directory in eclipse.

You can also put Help > Install New Software like the above. The address that you installed points to the ADT folder after the decompression.

4, Android SDK installation

Download the Android SDK Core pack for Linux version http://dl-ssl.google.com/android/repository/android-2.2_r01-linux.zip.

What you need to know is that this zip package is not a complete package. The Android package takes the form of a "component" that allows users to select components as needed. The zip file above contains only one component management tool and one basic tool component.

Below we configure the ADT already installed above. Configure the ADT in Eclipse to point to the Android SDK.

1. Choose Eclipse Window > Preferences ...

2. Choose Android

3. Click Browse ... Locate the Android SDK directory. For example my directory:/home/android/android-sdk-linux_86

4. Click Apply, and then OK.

The development environment builds basically builds up, but we still upgrade to download some things, the complete SDK all download. There are a number of update packages, including DOC documents, sample samples code, and SDK files. The entire process is automatically downloaded and installed:

1. Run Eclipse, choose Window > Android SDK and AVD Manager.

2. Select installed Packages on the left panel

3. Click Update all, appear Choose Packages to Install dialog, select Accept all, click Install. About 1.4GB of capacity. The net is no problem, one night absolutely finished.

4. Create AvD

To enable the Android application to run on the emulator, you must create a AVD.

(1) in Eclipse. Choose Windows > Android SDK and AVD Manager

(2) Click on the left panel of virtual Devices, and then click New on the right

(3) Fill in name, select target API,SD card size arbitrary, skin optional, hardware currently keep the default value

(4) Click Create AVD to complete the creation AVD

Read some information, now development is based on 1.6 development. Later only in the version of the compilation can be, I have not tried ~

5, Android NDK installation

Some Java developers have abandoned a process language like C, compared to Android open source projects, the C world has accumulated a lot of reusable open source projects (including many well-known games such as Quake, DOOM), in the execution efficiency involved in a large number of mathematical operations can also be considered by C completion.

It may be necessary to integrate the eclipse CDT to consider developing a C + + program. CDT, is the Eclipse's C/s + + environment, online installation address Http://download.eclipse.org/tools/cdt/releases/galileo. You can also install it manually after downloading it, as I have described above.

1. Start Eclipse and go to help > Install New Software.

2. In the Available Software dialog box, click Add ....

3. Add the Unpacked folder address->local choose OK after ok. Then select the desired content for the installation.

I ran a ndk example project and found that the CDT was not necessary and could be used later, or integrated with the QT development environment.

NDK Download Address: http://dl.google.com/android/ndk/android-ndk-r4b-linux-x86.zip

NDK installation is very simple, is to download the package to the specified location can be extracted, after decompression we generally need to configure environment variables, here we will be the configuration of environment variables in the last configuration.

Decompression Location:/home/android/android-ndk-r4b

 #vim/etc/profile 
  #set NDK env

  ndkroot=/home/android/android-ndk-r4b

  export path= $NDKROOT: $PATH

NDK compile time also need to configure some, to Hellojin. A classic hello~ created Android project to import with the presence of source.

Open Hello-jni Engineering Properties, select Builder, select Program, click OK.

Configured as follows, Ndk_builder,location and working directory

/usr/bin/bash and/usr/bin

Arguments to be consistent with your engineering catalogue.

My arguments is :--login-c "Cd/home/android/android-ndk-r4b/samples/hello-jni && $NDKROOT/ndk-build"

You can run it when you are done.

If you're using a CentOS Linux system, you're ready to start Android development.

Thank you for reading, I hope to help you, thank you for your support for this site!

Related Article

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.