Android Development Learning Summary (i)--build the latest version of the Android development environment

Source: Internet
Author: User
Tags android sdk manager java se

Android Development Learning Summary (i)--build the latest version of the Android development environment

Recently, due to work in the development of an Android app, before the development of Javaweb, Android development, although some understand, but has not built a development environment to learn, Android update speed is faster, Android1.0 was released in 2008, So far Android has updated Android5.0.1, the first step to learn Android development is to build the Android development environment, blog Park There are many people also wrote about how to build an Android development environment article, I also looked at a bit, but the feeling is relatively old, compared to do not necessarily can Enough to build a success, but some of the steps are still can be used for reference! This article is I borrowed from a number of friends of the article and add their own practice after the step-by-step arrangement! Alas, because of the full ban on Google, led to Google a lot of products are not used, all need to pass FQ to normal use, so in the country if you want to engage in the development of Android, or get a VPN, Android is also one of Google's products, Build Android development use of related software also need through FQ to be able to download, this virtually increases the learning cost of Android, build a most basic Android development environment to download the required software is childs, and the steps to build a development environment is very cumbersome, Maybe that's the threshold of entry that puts many developers out of the door for Android!

First, download the relevant software

Android Development Environment

  

Getting ready: Download Eclipse, JDK, Android SDK, ADT Plugin

: jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html

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

Android sdk:http://developer.android.com/sdk/index.html

Adt:http://developer.android.com/sdk/installing/installing-adt.html

The above to download the 4 software, in addition to the JDK, Eclipse, Android SDK, ADT plug-ins three need FQ to be able to download normally, if not FQ, then the above listed URL address is not normal access, so prepare FQ tools in advance, I'm using Pgfast, as shown in:

  

First step: Download the JDK

I downloaded the version of JDK1.7,: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

  

After downloading to your local computer, double-click to install. JDK installation process is relatively simple, Java developers will, in the installation of the JDK and JRE installed in the same directory can be installed, the JDK default installation, will appear in the system directory two folders, one for the JDK, a representative of the JRE

  

The full name of the JDK is the Java SE Development Kit, the Java Development Toolkit. SE represents the Standard Edition. The JDK is the core of Java, containing the Java runtime (Java Runtime Environment), a stack of Java tools, and a Java class library that is called when developers develop applications.

We can open the Bin directory under the JDK's installation directory, which has many executable programs with the suffix named EXE, as shown in:

  

These are the tools that the JDK contains, and we can easily invoke these tools and their commands by configuring the JDK's variable environment.

The basic tools included in the JDK are:

    • Javac:java the compiler to convert the source code into a byte code.
    • Jar: Package tool to package related class files into one file.
    • Javadoc: Document generator, extracting documents from source notes.
    • Java: Run the compiled Java program.

Step Two: Configure the variable environment for the JDK on Windows

In order to configure the system variable environment of the JDK, we need to set up two system variables, namely Java_home,path. The following are the settings for these two variables.

1, Java_home

First set this system variable name, the value of the JDK on your computer's installation path: E:\Program files\java\jdk1.7.0_75 After creation, you can take advantage of%java_home% as a unified reference path to the JDK installation directory.

  

2. Path

The Path property already exists and can be edited directly, appended to the original variable:;%java_home%\bin

  

The configuration of the JDK environment variables do Java development people should be, here is not detailed!

Step three: Download and install eclipse

There are multiple versions of Eclipse, and here you choose to download the Eclipse IDE for Java developers version.

  

Click on the "Windows 64Bit" hyperlink to enter the download page as shown

  

After the download succeeds, get a compressed package as shown:

  

Eclipse is an IDE (integrated development environment) developed for Java applications and Android. Eclipse itself is not required to install, after downloading the unpacking package directly after decompression can be used, as shown in:

  

At this, Eclipse's download and installation work is all done.

Fourth step: Download the Android SDK

The Android SDK provides the API libraries needed to develop Android applications and the development tools needed to build, test, and debug Android applications.

  

In order to avoid the installation steps, we choose to download the SDK package, click on the "Android-sdk_r24.0.2-windows.zip" hyperlink, go to the download page, as shown in:

  

After the download succeeds, get a compressed package as shown:

  

Here, the Android SDK is ready to download!

Fifth step: Download the ADT Plugin

To make Android apps easier to create, run, and debug, Android's development team specifically customized a plugin for the Eclipse IDE: Android Development Tools (ADT).

  

After the download succeeds, get a compressed package as shown

  

In this connection, all the software needed to use Android development is downloaded.

Second, the use of downloaded software to build the Android development environment

To facilitate the management of the software used in Android development, we can create a Androiddeveloptool folder on the disk and put the relevant software into this folder uniformly, as shown in:

  

First step: Install the Android SDK

In the above operation, we have downloaded the Android SDK compression package, now we have to extract the Android-sdk_r24.0.2-windows.zip compression package, extract to get a "android-sdk-windows" folder , this is the completion of the Android SDK installation work, the contents of the folder as shown:

  

In the Android SDK installation directory, double-click "SDK Manager.exe" to open the Android SDK Manager,android SDK Manage is responsible for downloading or updating different versions of the SDK package, we see the default installed Android SDK The manager installs only one version of SDK tools, as shown in:

  

At the same time, the SDK Manager will automatically help us select the latest version of Android, we just need to click the "Install" button to download the selected package, as shown in:

  

  

  

The SDK Manager downloads the installation of the Android development package as shown in the following procedure:

  

Using the SDK Manager to download the Android Development Kit also requires FQ to be able to download normally, some of the practices of the park friends are not FQ, modify the host file method, as shown in:

  

The above two lines in the host file mean that local access dl.google.com and dl-ssl.google.com are directed to a server with an IP address of 203.208.46.146, and then the Android SDK HTTPS request on manage changed to HTTP request

  

This method I tried, not successful, perhaps my luck is too back, so I still honestly get a VPN to FQ download it, my home is 4M network, download speed is good, download completed as shown below:

  

This download and installation process and its long, I spent nearly 2 hours to download the complete. The installed Android Development Kit and related tools are as follows:

  

I just downloaded the SDK Manager to help me select those packages, these packages are required to build the Android development environment for the minimum installation package, the other packages need to download!

Step two: Install the ADT plugin for Eclipse

Here we install directly from the downloaded ADT Plug-in package (this can be done in an offline environment). Unzip the Eclipse-jee-luna-sr2-win32-x86_64.zip compressed package, extract the successful, get an Eclipse folder, as shown in:

  

Double-click Eclipse.exe with your mouse to start Eclipse, the first time you start eclipse, you need to set up Eclipse's workspace, as shown in:

  

After setting up Eclipse's workspace, click the "OK" button to continue to launch eclipse as shown in:

  

After eclipse startup is complete, click on "Help" menu, "Install New software ..." as shown in:

  

Click the "Add ..." button in the Pop-up dialog box, as shown in:

  

  

  

  

  

This installation takes a little bit of time, as the installation process will download something as shown in:

  

A warning pops up during installation, as shown in:

  

Ignore this warning and click the "OK" button to continue the installation. After the installation is complete, a pop-up message box prompts you to tell us that you need to restart eclipse as shown in:

  

Click the "Yes" button to restart Eclipse. After eclipse restarts, it is intelligently associated with the Android SDK in its same directory based on the location of the directory, and if eclipse does not automatically correlate the installation directory of the Android SDK, it will pop up as shown in the prompts asking us to set up Android installation directory for the SDK

  

Click on the "Open Preferences" button, in the pop-up panel you will see the Android settings, fill in the Installed SDK path, will appear in the SDK installed in the platform package, press OK to complete the configuration. As shown in the following:

  

We just downloaded the Android5.0 package with the SDK manager, so only the Android5.0 platform is shown here.

Here, we build on the Android development environment on Windows, when you use Eclipse's file--"new--" Project ... When you create a new project, you'll see the option to build an Android project. As shown in the following:

  

Step three: Test the Android development environment for success

Create a new Android project using Eclipse, as shown in the following steps:

  

  

  

  

  

  

  

Create a good project as shown in:

  

After the project was successfully created, we ran the Android project directly, and the steps to run the Android project in Eclipse are as follows: Select project-----right mouse button------"Run as"------"Android Application", As shown in the following:

  

Select the emulator for the debug Android app, as shown in:

  

I opened the phone's USB debugging mode, directly using the phone as a simulator to run the Android application, the console print out the log information as follows:

  

The results of the application on the phone are as follows:

  

Run successfully. There will also be an icon for our app on the phone, as shown in:

  

This is where the testing of our Android development environment is all done.

III. Configuring environment variables for the Android SDK

Configuring the environment variables for the Android SDK is not something you have to do to build an Android development environment, but it is easy to use the tools in the Platform-tools and tools directories in the command-line window after you have configured the Android SDK installation directory. So it is better to configure a bit, convenient to use!

The environment variable value for the Android SDK is the directory path for the Platform-tools folder and tools file folders under the SDK installation directory, as in my case: E:\AndroidDevelopTool\android-sdk-windows\ Platform-tools, E: \androiddeveloptool\android-sdk-windows\tools, in the variable value, two paths are separated by commas.

(1) Add environment variables:

Variable name: android_sdk_home

Variable value:E:\AndroidDevelopTool\android-sdk-windows(the installation directory for this Android SDK)

  

(2) Add the following in path:

%android_sdk_home%\tools;%android_sdk_home%\platform-tools

  

  

Use the shortcut key "Win+r", then enter CMD, enter the command line, input the android-h and ADB commands separately, show that the Android SDK environment variable is already configured.

  

  

Briefly talk about the main features of the ADB tool in the Platform-tools directory:

    • Shell running the device (command line)
    • Manage port mappings for emulators or devices
    • Upload/download files between your computer and your device
    • Install the local APK software to the emulator or Android device

Iv. Summary

The above is to build the latest version of the Android development environment of all content, build steps and process is I personally practice, in accordance with the above construction process should be able to build the normal development environment of Android, write this article spent a lot of time, in the spirit of not fraught, serious and responsible attitude, to each Process and possible problems are as clear as possible, I hope all the friends who read this article can build up the Android development environment, stepping into the door of Android development! Some of the contents of this article refer to the following articles from several friends:

1, the life of the Android configuration----Android development environment to build

2. Zhen Yi's Android Foundation uses Eclipse to build an Android development environment and create the first Android project (Windows platform)

3, while writing and singing five steps to take care of Android development environment deployment--Very detailed Android development environment Building tutorial

Thanks again for these friends, I have just started Android development, I hope to have more opportunities and blog Park friends to learn the development of Android!

Android Development Learning Summary (i)--build the latest version of the Android development environment

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.