10-Day Learning Android Development (1)-Environment building and hello Testing

Source: Internet
Author: User
Tags windows x64 windows x86

The first thing to do is to build the environment and then create a simple HelloWorld . The topics in this article are as follows:

    • 1, Environment Construction 1.1, JDK installation 1.2 Eclipse installation 1.3 Android SDK installation 1.4, ADT installation 1.5, create AVD 2, HelloWorld
1 Environment Build 1.1, JDK install Java and configure environment variables http://www.oracle.com/---->downloads--àjava fordevelopers--àjdk, select Windows X86 (32-bit) or Windows X64 (64-bit)
  1. My Computer -> advanced -> -> system variables add the following environment variables:

  2. Java_home values are: D:\ProgramFiles\Java\jdk1.6.0_18 ( you install JDK the directory )

  3. CLASSPATH values are: .; %java_home%\lib\tools.jar;%java_home%\lib\dt.jar;%java_home%\bin;

  4. Path: at the beginning of the append %java_home%\bin;

  5. NOTE : set up the environment variables in the previous four steps Android The development environment is not required and can be skipped.

    after the installation is complete, you can check the JDK whether the installation was successful. Open the cmd window and enter java–version to view The version information for the JDK. Some version information appears to indicate that the installation was successful:




1.2 Eclipse adt ,adt )

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

      Eclipse IDE for Java developers

      Can be used directly after decompression






1.3 Android SDK installation

    1. in the androiddevelopers Download ANDROID-SDK unzip to any path when the download is complete. Website: developer.android.com

Run Sdk setup.exe and click Availablepackages. If the installable package does not appear, click Settings, and select "force  " in misc. Run  android –h If you have a large amount of information similar to the following, indicating that the output is successful   (Add the SDK directory to the Windows PATH environment variable: On the desktop, right-click My Computer, tap Properties > Advanced > "Environment variables". Double-click the path entry in system variables to add the full path to the tools directory in ANDROID SDK. The path entry should contain: d:\android\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;d:\android\adt-bundle-windows-x86_ 64-20140702\sdk\tools;%java_home%\bin;)  1.4 adt not be able to directly develop Android programs in Eclipse, we need to install an ADT plugin http:// www.android.com/---->tools---"download thesdk  adt boundle for windows open  eclipse ide, go to "help"  ->  "Install new software" in the menu   click Add ... button, the popup dialog asks you to enter name and location:name yourself, location input. After confirming the return, select the ADT we just added in the drop-down list after Work with, and we'll see that there's a developer tools below, and it will have android  Ddms and Androiddevelopment tool, tick them. As shown in:  (if not, click Reload ' Reload ') then just follow the prompts step by step next.   (You can also go directly to the Android website to download the ADT plugin: http://code.google.com/android/adt_download.html After the download is complete, the "FeaturThe files in the ES "and" plugins "directories are copied to the corresponding directory in eclipse)   Restart Eclipse for ANDROID SDK settings: After completion: select Window > preferences...  on the left panel select Android, then on the right click Browse ... and check the SDK path, this machine is:  d:\androiddevelop\android-sdk-windows e:\java installation file \adt-bundle-windows-x86_64-20140702\ ADT-BUNDLE-WINDOWS-X86_64-20140702\SDK click Apply, OK. Configuration complete    New development tools: Android studio, currently beta  2 hello Test    (1) File---> New  -->new android application  (2) Right-click the project name->run as ->android application   Start running the Android program    main directory structure:  1) src: Source code   such as:public class mainactivity  extends actionbaractivity {     @Override     protected  Void oncreate (bundle savedinstancestate)  {         Super.oncreate (savedinstancestate);         setcontentview ( R.layout.activity_main);//Set the main interface d    } 2) Res: Resource   Interface file: XML file under Layout, main interface file:/ACTIVITY_MAIN.XML 3) Libs: library, third-party platform, support for C or C + + development of dynamic library  4) The resources under Gen:res all generate an ID that can be seen under Gen, such as the:  main interface id:public static final int activity_main=0x7f030018 ;  5) asserts: Resources not compiled    contemporary code in Chinese: file->property->text fil encoding for UTF8 (or right-click on project Properties, can also be set)   Right-click Project:  run as android application, run             debug as android application, debugging, can set breakpoints in code and so on.                      Reference Articles:
Http://www.php100.com/html/webkaifa/Android/de_news/2013/0221/12082.html
Http://www.cnblogs.com/skynet/archive/2010/04/12/1709892.html

This article is from "Blue Sea Tactics" blog, please make sure to keep this source http://wanxl.blog.51cto.com/2129901/1584661

10-Day Learning Android Development (1)-Environment building and hello Testing

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.