Beginner Android Environment Setup

Source: Internet
Author: User

Beginners in Android development without the development tools and environment. The Android installation environment is configured like this: Download and install the Android SDK, download and install the JDK, download and install Eclipse, download and install ADT.

1. Introduction 1.1 Android SDK:

Provides a range of tools including emulator (simulator) with analog hardware devices, Androidasset Packaging tool (AAPT) Android Resource Packager, Dalvik Debug Monitor Service (DDMS) Dalvik Debug Monitoring Service, Androiddebug Bridge (ADB) Android Debug Bridge, and DX tool to convert. class bytecode files to. dex files.

In the SDK folder, you can find:

SDK/BUILD-TOOLS:AAPT, DX tools (only appear after online installation)

SDK/PLATFORM-TOOLS:ADB (will not appear until after online installation)

SDK/TOOLS:DDMS, Emulator


1.2 ADT (Android developmenttools):

Google offers an Android development plugin for Eclipse ADT, which can be integrated through ADT, including automatic code generation, debugging, compiling, packaging, and drag-and-drop interface generation.

1.3 Android SDK, JDK, Eclipse, ADT relationships:

ADT must have support for Eclipse and the Android SDK, and Eclipse must have JDK support.

Tools in the Android SDK package can be invoked in DOS commands, related development, debugging, compiling, packaging, deployment, etc., but less efficient, solid Android provides plug-in ADT developed for Eclipse. As a result, we can use ADT to create programs in the Eclipse development environment, and invoke tools in the Android SDK (such as DDMS, Emulator) for visual deletion, adding view components, and more, to improve development efficiency.

The purpose of installing the JDK (Javadevelopment Kit) is to install the Java development environment, because the application layer of the Android SDK uses the Java language and the Java development environment is required for the solid.

2. Install configuration 2.1 After installing the JDK, configure the Java environment variables:

Configure Java Home:

Copy the Java path, right-click My Computer-Properties-advanced-environment variables, create a new system environment variable java_home in the system environment variable, and the variable value is the Java installation path. Example: D:\Android software\java\jdk1.7.0_45

Configure path (Purpose: Ability to use Java's compile, run, and command tools):

Right-click "My Computer"-"Properties"-"advanced"-"Environment variables", edit the PATH variable in "System environment variables", add Java Bin directory, and use ";" between variables. Separated. For example, D:\Android Software\java\jdk1.7.0_45\bin

Configure Classpath (Purpose: To successfully run Java classes, configure their classpath) :

Right-click "My Computer"-"Properties"-"advanced"-"Environment variables", create a new system environment variable CLASSPATH in the system environment variable, the value of the variable is the English half-width period "." Indicates that the class can be found under the current directory.

Experience with Java development will understand that its classpath is set to ".; %java_home%\lib ", which also contains a half-width period. The first time to get started Java programming is HelloWorld, you should be particularly familiar with. For example, the D-Packing directory (the directory where the execution of the Class) has a written Helloworld.java file, under DOS switch to the D-packing directory, enter Javac Helloworld.java, after carriage return, the operating system will be based on the path specified in the path (d:\ Android\software\java\jdk1.7.0_45\bin) go to find the Javac program, find out after executing this command, in the directory where the Helloworld.java is located (that is, the D packing directory) Generate Helloworld.class, and then enter Java Helloworld in the console. Here Classpath represents the current execution class, run-time Java based on "." In Classpath. Knowing the path of this class that we wrote ourselves, and then we wrote the class from the class path "%java_home%\lib" in Classpath to invoke the system provided to our class library to implement.

2.2 Download SDK and unzip 2.2.1 Installation

After you run the SDK Manager.exe select the package you want to install, click the Install Selected button to pop up the confirmation dialog box and click the Install Accepted button to install it online.

2.2.2 Encountered an update download failure problem (progress bar is almost static, not forward):

...

Failed to fetch Urlhttps://dl-ssl.google.com/android/repository/addons_list-2.xml, reason:connection to https:// Dl-ssl.google.com refused

Fetched add-ons List successfully

Fetching Url:https://dl-ssl.google.com/android/repository/repository-8.xml

Failed to fetch Urlhttps://dl-ssl.google.com/android/repository/repository-8.xml, Reason:httphostconnect Connection To Https://dl-ssl.google.com refused

...

Troubleshoot problems with accessing Google servers:

1) Launch Android SDK Manager;

2) After opening the main interface, select "Tools" – "Options" to eject the "Android SDK manager–settings" window;

3) in the "Android SDK manager–settings" window, fill in the "HTTP ProxyServer" and "http Proxy Port" input boxes with mirrors.neusoft.edu.cn and 80 respectively, and select " Force https://... sources to be fetched using http://... "check box;

4) Then click the "Close" button to close the window;

5) Select "Packages"-"Reload";

6) Repeat 2.2.1 steps to

2.2.3 If the Android version does not appear

1) Open the Hosts file under the C:\Windows\System32\drivers\etc path, and select the TXT text mode to open

2) After adding the following code:

#google_android更新

203.208.46.146 dl.google.com

203.208.46.146 dl-ssl.google.com

Note the space and line break keys

2.3 Download Eclipse2.3.1 Follow the steps to install Eclipse2.3.2 download install ADT1) Online update

A. Select "Help"-"Install New software. ”

B. Click "Add ... ", add an update site (note that HTTP does not add s), or the link fails

Name is preferable to "ADT 0.9.5" (named arbitrary);

Location input http://dl-ssl.google.com/android/eclipse;

C. Issues that cannot be updated

You can open the Hosts file under C:\Windows\System32\drivers, and then repeat the a &b step after adding the following content;

2) Download ADT plug-in Package manual configuration

A. Direct download of ADT

b After decompression, copy the contents of the plugins package and the features package to eclipse's corresponding plugins package and features package and restart Eclipse.

After the installation is successful, restart Eclipse, open the "Preferences" dialog box under the "Windows" menu, and the list on the left will have an extra "Android" option.

2.3.3 Add SDK

1) Start eclipse;

2) Select "Preferences" under the "Windows" menu and pop up the "Preferences" dialog box;

3) Select the "Android" option in the list on the left and select the path of the SDK in the SDK location box;

3. Other

Completed the complete Android development environment, for the first contact in this regard, the software installation is not familiar with, you can choose to download adt-bundle-windows-x86-20130917.467161976, which is an integrated file, which contains:

Eclipse + ADT plugin, Android SDK Tools, JDK, Eclipse, etc.;

1) Install the JDK as per the previous steps;

2) Open Eclipse, select "Windows"-"SDK Manager" to install the package online, the following steps are

3) After the installation of the update can be;

Beginner Android Environment Setup

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.