Build Android phone system development environment (GO)

Source: Internet
Author: User

Android, which has been a very powerful mobile phone operating system, has become increasingly popular with developers, and this article will lead you to build your own development environment from scratch.

First, JDK download installation

The JDK full name is Java development Kit, which is the core of Java, but also the most basic element to build a Java environment, note that it differs from the JRE (Java Runtime Environment), which is the Java Runtime Environment, In addition, the JDK contains the JRE, but the JDK also contains a collection of other tools, as well as the Java base Class library, for. NET developers, this is a bit like the. NET Framework and CLR relationships. The development language of Android mobile app is Java, so in order to develop our own application, we have to download the JDK, the latest version is 6.0, you can download it through the following website: http://www.oracle.com/technetwork/ java/javase/downloads/index.html, then select Download JDK, and after entering the download page, choose the version that suits you.

After downloading the first decompression, because the download is an EXE executable file, so as long as the normal Windows installation files just double-click to complete the installation. After the installation, let's talk about how to configure, specifically, how to set the environment variables (for all Java developers I'm sure I know this step, and the author writes it down to make it easier for developers who aren't Java or forget how to set it up). The following configuration is based on the Windows 7 operating system, other similar.

Open environment variables: Right-click Computer, select Properties, select "Advanced system Settings" on the left, and select "Environment variables", the final effect is as follows:

    1. Create a new variable java_home, which is a Java installation folder, such as C:\Program files\java\jdk1.6.0_23;
    2. Create a new variable classpath with a value of.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;%java_home%\jre\lib\rt.jar;
    3. Modify the value of the path variable and append C:\Program files\java\jdk1.6.0_23\bin after the value;

The following can be done by running the following command to confirm the success of the installation, open a command prompt, enter java-version, the result screen, the installation has been successful.

Second, Eclipse download installation

In this article, we will choose Eclipse as the integrated development environment for Java, which can be obtained through the following links: http://www.eclipse.org/downloads/, unzip after download.

third, Android SDK download installation

Download Sdk:http://d132.d.iask.com/fs/800/1/f42685f3daadde63feef6c0c6fd9d42138309887/zip/android-sdk_ via the link below R07-windows.zip, unzip to run, and like the JDK, we also set in the environment variable, open the environment variable, choose New Path, the value is SDK tools decompression path, for example: J:\Softs\Java\android-sdk_ R07-windows\android-sdk-windows\tools, finally enter android-h at the command prompt to check whether the installation was successful.

Iv. ADT (Android development Tools) Download and install

Open Eclipse, choose menu Help->install New software, type Http://dl-ssl.google.com/android/eclipse in work with: The developer Tools will appear in the results column below, select and click Next to install them all the way down.

Let's set up the Android SDK location below.

First open eclipse, then select Window->android SDK and AVD Manager, the following screen appears

Select available packages in the left column, then select the option to the right, then click Install Selected in the lower right corner after selecting, this step to the author's experience, it takes a period of time, need to wait patiently.

Select Window->preferences, select Android from the left column, and then enter in the SDK location on the right or select the SDK installation path via browse, and finally click on the Apply or OK button, as shown below:

v. Creating an AVD

Window->android SDK and AVD Manager from the menu bar

Click on the New button, fill in the name, select the target API,SD card size arbitrary, skin random selection, hardware currently keep the default value, and finally click Create AVD

vi. Creating a test program

Open the ECLISPE development environment and select File->new->project->android->android Project

Writing Java programs

Package cn.younext;
Import android.app.Activity;
Import Android.widget.TextView;
Import Android.os.Bundle;
public class HelloWorld extends Activity {
/** called when the activity is first created. */
@Override
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.main);
TextView tv=new TextView (this);
Tv.settext ("Hello Android, I ' m chunting");
Setcontentview (TV);
}
}

Run Run->run Configurations

Select the AVD created in target, click Apply, and then click Run

The final is as follows:

Because the Download SDK website will be lost by the celestial wall, so we need to download manually. Based on the following URL
Http://dl-ssl.google.com/android/repository/addons_list.xml
Http://dl-ssl.google.com/android/repository/repository-5.xml
The two XML files will contain some level two links, the first of which is mostly APIs (for Google and other companies), and the second is the specific Android SDK platform and some platform tools.
If you open a Google API link https://dl-ssl.google.com/android/repository/addon.xml under the first file, you will see the corresponding file when you open it.

We are opening a second XML file to see if

That is the SDK for Android 2.3.3.
All the resources we need to add http://dl-ssl.google.com/android/repository/in front can be downloaded, namely:
Http://dl-ssl.google.com/android/repository/samples-2.3.3_r01-linux.zip Note that although the name contains Linux, it is actually cross-platform that Windows can also use
Http://dl-ssl.google.com/android/repository/platform-tools_r08-windows.zip
Http://dl-ssl.google.com/android/repository/tools_r14-windows.zip
Note that the different platform downloaded must be in different folders, such as 2.3.3 must be placed under PLATFORMS\ANDROID-10, the remaining two resources, that is, platform tools and tools are the same for all platforms.
The complete structure diagram is as follows:

Build Android phone system development environment (GO)

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.