[Android] Step 1: Build a Windows-based Android Development Environment

Source: Internet
Author: User

Collation: I wrote a technical blog for the first time. Although I have been an IT worker for so many years, I have worked as SDE and SDET, and both sides have such an empty lead title, but to tell the truth, I really want to calm down, put aside the troubles of my work, put aside the trivial aspects of my life, put aside the secular prejudice, and then do what I like, android. Android is simply an interest of mine, because I bought an Android phone and liked it. Then I wanted to do it. That's all. My work uses the programming language C #, which is unrelated to Android/Java/eclipse. Therefore, in the face of Android, I have nothing to do with a newbie, but what I want to do is, while enjoying the fun Android programming brings to myself, I share my learning process and experiences with you in the spirit of being a mentor, and it is inevitable for new users to go on the road and make mistakes, you are welcome to give more valuable comments. Finally, I don't expect my blog to be able to solve the problems in my work and create much value, because I am just a newbie in this regard, I just hope that there will be more and more Android programmers, such as me, and even Coding Experts. I am using my blog to get in touch with Android development, and I am interested in Android development. I want to devote myself to work, leisure, and entertainment, I have implemented some of my ignorant ideas on my mobile phone or tablet, and enjoy the joy Android brings to myself throughout the process.

Touch it, think it and do it.


First, I went to the official Google website developed by Android and learned from the above that the current Android SDK (software development kit) Version 4.1, nicknamed jelly bean, it is also known that the android SDK is based on the JDK (Java SE development kit), and Android development tools are widely used, and eclipse is a common tool. By understanding the basic knowledge above, the order of building the android Development Environment basically comes out.

1. Java SE Development Kit (JDK)

2. Android SDK

3. Eclipse

Install Java SE Development Kit

1. Go to the Java official website to find the JDK for Windows installation package.

2. Download JDK version 7 update 9

3. After the download is complete, it is a Web installation package of more than 800 K. The real installation file will be downloaded during the installation process. Double-click it and the installation interface is as follows.

 

4. Click Install to install the SDK, or select change destination folder to change the installation path. For me, the underlying SDK is usually the default installation path. Click the Install button to go To the download page, as shown in.

 

5. I won't talk about the following things, and I have nothing to worry about, because it seems that the entire installation process is fully automated (there is a form pop-up that is also crazy to press the next button, so I was quite impressed.) There will be a prompt when the installation is complete, and I forgot to remind me of it.

 

Prompt: It seems that Java does not officially recommend that you use a 64-bit JDK on a 64-bit Windows operating system, the reason is that the 64-bit Windows operating system uses the 32-bit IE browser by default (although the 64-bit windows browser is installed ). Of course, we don't need IE, so if we want to install a 64-bit JDK on a 64-bit Windows operating system, you can find the 64-bit JDK and 32-bit JDK on the manual download page of the official Java website. The installation package size seems to be the complete installation package, you do not need to download the installation package as in the Web installation package. The following is the original article on the Java official website.

SUMMARY  64-bit Windows operating systems (which may be Windows 7, Vista or XP) come with a 32-bit Internet Explorer (IE) browser as the standard (default) for viewing web pages. These operating systems also include a 64-bit Internet Explorer browser, however using it is optional and it must be explicitly selected to view web pages. Note that because some web content may not work properly in a 64-bit browser, we recommend using the default 32-bit browser and downloading 32-bit Java. 

  

6. after JDK is installed, check whether Java environment variables are correct in environment variables (environment variables). If Java environment variables are not automatically configured during the installation process, subsequent Android SDK installation will fail. Of course, you can skip this step to install the android SDK directly. If the installation fails, check again. To do this, right-click my computer and choose advanced system settings from the upper-left corner of the pop-up window. Click, find the "environment variable" button in the lower-right corner of the "System Properties" dialog box that appears, and click it to view the environment variables and values of the current system. Because my operating system is in English, I just want to guide the students who are not familiar with the Windows operating system. In addition, the yellow box contains the current Windows type, it indicates whether the current Windows operating system is 32-bit or 64-bit.

 

  

The environment variables to be checked include java_home, path, and classpath, as shown in the following code:

Java_home

C: \ Program Files (x86) \ Java \ jre7;

Path

% Java_home % \ bin;

Classpath

.; % Java_home % \ Lib \ tools. jar;

Prompt: If one or more of the three environment variables exist in the system, such as path,Do not overwrite all values.This will affect the use of other software in the system. We recommend that you add the value and separate the values with English characters. This will not affect other software. I accidentally overwrite the value of the entire path, and all other values in it are lost. As a result, I cannot use any command in cmd (Windows command line ).

64-bit JDK InstallationBecause my JDK is 32-bit and the operating system is 64-bit, the java_home path is c: \ Program Files (x86) \ Java \ jre7, if a 64-bit JDK is installed, the path should be c: \ Program Files \ Java \ jre7. If you are not sure about the path, you can take a look at the path and finally remind you to add it; the path of java_home should contain the bin directory and lib directory. Otherwise, the path and classpath cannot work.

 

7. After completing the preceding steps, install JDK.

 

Install Android SDK

1. Go to the SDK page on the android official website to learn how to download the SDK.

2. Download the android SDK

3. The downloaded installation package is 67.2 MB, which is the complete installation package. Double-click it to start installation.

4. After the installation starts, the first page is a friendly interface, such as welcome to Android, which is directly next.

5. If the previous JDK is successfully installed, the android SDK will automatically match the installed JDK, as shown in the following figure.

 

6. next, select install for anyone using this computer (Android SDK can be used by anyone on this computer) or install just for me (Android SDK only ), if you do not need to switch back and forth between multiple Windows accounts, install just for me is enough. I personally prefer for anyone, because I am worried that sometimes on Windows permissions, you may have insufficient account permissions and need to switch to the administrator account.

 

7. The rest is the installation path or something, which can be directly defaulted, followed by next, directly to the end of installation.

8. after the installation is complete, start to work properly. In the start-> Program-> Android SDK tools path, there will be an SDK manager tool, this tool is used to manage the package of the local Android SDK. The interface is shown in. (When it is opened, it will download some XML data files from the Internet, and then refresh the package list. This process depends on the speed of the network, so the list may be blank at the beginning)

 

As you can see, here we can choose to update, install a new package, or delete an existing package. Currently, the android SDK platform contains) to Android SDK platform of Android 4.1.2 (API 16), we recommend that you find an android SDK platform that is supported by the current device (mobile phone or tablet) and be installed with a slightly newer version, A platform is enough for beginners to learn. The official recommendation is that it should be at least 2.2. For example, if my mobile phone is Android 4.0.4, you can choose Android 4.0.3 (API 15) for installation. In fact, I have installed the latest Android 4.1.2 (API 16). Although some of the demos I am currently working on can be debugged on mobile phones, however, the code I wrote may not be supported on my mobile phone any day, so I suggest you find a version that is supported by the current device for installation. Android official installation suggestions for these SDK packages are as follows:

  • [Required] SDK tools, which is the android SDK tools under the tools folder in the figure.
  • [Required] the SDK platform-tools is the android SDK platform-tools in the tools folder in the figure.
  • [Required] the SDK platform is Android 4.1.2 (API 16) and Android 4.0.3 (API 15) in the figure.
  • [Optional] system image, which is the arm Eabi v7a system image, intel X86 atom system image, and MIPS system image under Android 4.1.2 (API 16) in the figure. These packages provide virtual machine debugging for our code. As the android official saying, everyone should have at least one Android device, so these system images are optional, we can directly connect to our Android devices for debugging. Moreover, the speed of the android virtual device can be really a turtle speed, at least I can't bear it, so I personally do not recommend it. Of course, you can find AVD manager in the path "start-> Program-" android SDK Tools ", where you can configure the android virtual machine. I won't bother here.
  • [Optional] Android support, which is not captured in the figure above. If you pull down the scroll bar, you can find a folder named "EXTRAS". Under this folder, there is the android support library, this package is mainly used to support the latest API in earlier versions of Android SDK platform. Details about this package are provided in the official Android support library.
  • [Optional] SDK samples, which is the samples for SDK under Android 4.1.2 (API 16) in the figure. Each SDK must have samples for SDK under platform. These samples provide Android code, it demonstrates how to use the API in the SDK.

The official Android SDK package suggestions are as follows, because some of them are beyond the scope of the development environment, so I did not propose them. In addition, to prevent my personal English skills from being limited, there are some unnecessary errors, so I have referenced them in the original article.

Recommended packages

Here's an outlines of the packages required and those we recommend you use:

SDK tools
Required.Your new SDK installation already has the latest version. Make sure you keep this up to date.
SDK platform-Tools
Required.You must install this package when you install the SDK for the first time.
SDK Platform
Required.You must download At least one platformInto your environment so you're able to compile your application. in order to provide the best user experience on the latest devices, we recommend that you use the latest platform version as your build target. you'll still be able to run your app on older versions, but you must build against the latest version in order to use new features when running on devices with the latest version of Android. to get started, download the latest Android version, plus the lowest version you plan to support (we recommend Android 2.2 For your lowest version ).
System Image
Recommended. although you might have one or more Android-powered devices on which to test your app, it's unlikely you have a device for every version of Android your app supports. it's a good practice to download system images for all versions of Android your app supports and test your app running on them with the android emulator.
Android support
Recommended. except des a static library that allows you to use some of the latest Android APIs (such as fragments, plus others not supported ded in the framework at all) on devices running a platform version as old as Android 1.6. all of the activity templates available when creating a new project with the ADT plugin require this. for more information, read support library.
SDK Samples
Recommended. the samples give you source code that you can use to learn about Android, load as a project and run, or reuse in your own app. note that multiple samples packages are available-one for each Android platform version. when you are choosing a samples package to download, select the one whose API level matches the API level of the Android platform that you plan to use.

 

9. After installing the required package, the installation and configuration of the android SDK have been completed successfully. Next, install eclipse.

 

Install eclipse

1. Go to the eclipse download page to learn about eclipse.

2. Android officially recommends using the eclipse classic version. Here we can select the 32-bit or 64-bit version of eclipse classic 4.2.1 for windows for the JDK version we first installed. Note: The selection of the eclipse version is irrelevant to whether Windows is 32-bit or 64-bit. It is only related to whether JDK is 32-bit or 64-bit. If Windows is 64-bit, JDK is 32-bit, and eclipse also needs to download 32-bit. Otherwise, the system will prompt that JDK does not match and eclipse cannot be started.

3. the downloaded eclipse is a zip package. After decompression, you can double-click eclipse in the directory to start the package directly. at startup, you will be prompted to specify a directory as the workspace, it is the place where the projects created by default eclipse are stored. You can change the path or directly default it as you like.

4. What we need to do after the startup is to install the ADT plugin provided by Android. The full name of ADT is Android development tools. It is a plug-in developed specifically for eclipse by Android, which enables users to quickly create Android projects from eclipse.

5. Select help-install new software from the menu bar, click the "add" button in the pop-up form, add name in the pop-up form, and fill in "release" in location.

6. After clicking the "OK" button, eclipse will automatically connect to this address and obtain the download information. After obtaining the information, the following information is displayed.

 

7. The other thing is to check all the plug-ins, next, accept all protocols, and then download and install the ADT.

8. finally, after all the ADT plug-ins are installed, you will be prompted to restart eclipse. After the restart, select File-> New-> Project in the menu bar, and in the pop-up new project form, you can create an Android Application project.

 

Congratulations

All the android Development Environment setup work has been completed! But at the end...

@ Students who failed to download ADT automaticallyIf the automatic download of ADT plugin fails, you can choose to install it manually. I downloaded it automatically, so I haven't tried the manual installation, but I will share it with you to help students with poor network speeds.

1. manually download the ADT plugin manual installation package

2. The downloaded file is a zip file. Do not decompress it.

3. on the eclipse menu bar, select help-> install new software, and click the "add" button in the pop-up form. Like automatic download, the name can be customized, and then click "ARCHIVE, select the downloaded ADT plugin manual installation package and click open.

4. The next step is similar to the automatic download step.

Appendix: For more information about how to install ADT, see troubleshooting.

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.