1 Software Downloads
(1) jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
(2) eclipse:http://www.eclipse.org/downloads/
(3) Android sdk:http://developer.android.com/sdk/index.html
Download: Installer_r22.6.2-windows.exe or Android-sdk_r22.6.2-windows.zip
(4) adt:http://developer.android.com/sdk/installing/installing-adt.html
Download: Adt-22.6.2.zip
2 installation
2.1 JDK installs JDK and configures Java_home environment variables.
2.2 Eclipse extracts eclipse.
2.3 Install the Android SDK double-click Install Installer_r22.6.2-windows.exe.
Configure environment variables after installation:%android_sdk_home% = C:\ProgramDev\Android\android-sdk. If you do not configure Android_sdk_home, after you open SDK Manager.exe, the resulting related files are located in the C:\Users\ (user name) \.android directory and the environment variables are configured. The ANDROID directory will be located in%android _sdk_home% point to the directory below.
2.4 Installation ADT Click Help->install New Software, then add->archive-> find our download good adt-22.6.2.zip, also give a name, such as ADT Plugin, the following figure:
When you are sure, tick developer Tools and Next:
Then click Next and Continue.
3 run Eclipse3.1 open Eclipse configuration Android SDK location
3.2
Toggle Pivot Chart
We first switch perspective to Java, find the upper right corner of the perspective button, in the pop-up window to select Java, OK.
There was a small change in the toolbar, with two small buttons: The SDK manager on the left, and the Android Virtual Settings Manager on the right, the AVD (Android fictitious Device) manager. We're going to operate it right away.
Note: There is no Android icon for toolbars in the Java EE view. 3.3 Creating a Device
AVD (Android virtual Device) is the virtual device that the Android application runs on. To build an Android application to run, you must create AVD, and you can configure a lot of running items on each AVD.
Click on a small button on the toolbar similar to the Phone, pop-up dialog box:
Click New, we will create a new device: SD card in the system to generate an equivalent size of the file, used to simulate the SD card, it should not be set too large.
Click OK to create a new success.
4 Creating the Hello World Project
Click on the file-> New-> Android application Project
Fill in the application name and the corresponding information, package name is generally the site domain name upside down to write, package name must be unique, otherwise it is considered the same program. The target version is the most compatible version. Click Next:
Mark this project as a library: the basis for other applications, as a package exists.
The above is the icon to set up the launcher.
is to create a template selection for an application.
Click Finish to create a project to complete.
When you are done, the Project Explorer window has a HelloWorld.
SRC source file
Gen ADT automatically generated Java files, programmers must not go to modify
Android 4.4.2+android Private Libraries jar file
Assets resource files, pictures, audio, video, etc.
Bin binaries, compiled files
Libs A third party jar file that refers to a third party code
Res is also a resource file, and unlike assets, the generated files have IDs
5 Running Hello World Project
Right-click on the HelloWorld, Run as->run Configuration:
Or on the HelloWorld right click, Run as->android application:
It may take a few minutes to start the first time, please wait patiently:
Hello world! has not yet written a code, but the classic Hello World interface appears. After seeing this interface, your Android code tour is officially set to sail.
6 Offline download Android SDK
When you open the SDK Manager.exe, it is very slow to download the associated SDK. You can manually obtain the download addresses of these packages and download them by using the Download tool, installed manually. The installation method is simple, with the emphasis on getting the download address, because each version update address may vary. When the download is complete, put the downloaded compression pack under the Temp folder.
For example: C:\ProgramDev\android\android_sdk\temp.
Then execute the Android SDK Manager to select the packages you have downloaded to install.
6.1 Get offline installation package address
In SDK Manager, open the View Log button in the lower-right corner (the button to the right of the red hand) to get the read XML file log. Carefully look at the log file, found that the law is as follows: First load an XML file, parse the XML file, and then from the XML file to obtain the corresponding classification of the file version information. Open these XML files one by one, the discovery is to describe the version information of each category file, at this time we can view each file name from the XML file, just fill in the file name to this download address to complete the download:
Https://dl-ssl.google.com/android/repository/******.zip (The following ******.zip is based on the file you need to download to fill in).
When you view the SDK Manager log discovery, the SDK manager downloads the following XML files for each update:
Http://dl-ssl.google.com/android/repository/repository-8.xml
Http://dl-ssl.google.com/android/repository/addon.xml
Https://dl-ssl.google.com/android/repository/addon-6.xml
Write a simple program, the name of which is the label corresponding to the URL of the content, stitching in the path http://dl-ssl.google.com/android/repository/, you can get all the necessary installation package download address, And then you can use the download tools such as thunder download, download the good package to the SDK root directory in the Temp folder, and then install, you can directly install, save a lot of time.
6.2 Resolution Address Program
Use the Dom4j-1.6.1.jar library, please download it yourself.
Import Java.io.BufferedWriter;
Import Java.io.File;
Import java.io.FileNotFoundException;
Import Java.io.FileWriter;
Import java.io.IOException;
Import java.net.MalformedURLException;
Import Java.net.URL;
Import Java.util.Iterator;
Import java.util.List;
Import org.dom4j.Document;
Import org.dom4j.DocumentException;
Import org.dom4j.Element;
Import Org.dom4j.io.SAXReader;
/**
* 2014-04-20:wintys changed from Zqy ' s Urlfinder
* ==============================================
* This program is allow to catch the URL of the installation packages
* Download by Android SDK Manager. Run this program and get packages ' URLs
* In the Urlfile.txt, copy them to Download Tools to Download them faster.
* (the speed is extremely slow)
* Copy the downloaded packages to {Your installation path of Android Sdk}/temp
* and install them fast in SDK Manager. Enjoy.
*
* @author zqy
*
*/
public class Androidsdkurlparse {
/* The XML files the SDK Manager read ... */
public static final String repository = "Http://dl-ssl.google.com/android/repository/repository-8.xml";
public static final String addon = "Http://dl-ssl.google.com/android/repository/addon.xml";
public static final String addon6 = "Https://dl-ssl.google.com/android/repository/addon-6.xml";
public static final String Addon2 = "Http://software.intel.com/sites/landingpage/android/addon.xml";
public static final String sysimg = "Http://www.mips.com/global/sdk-sys-img.xml";
public static final String Sysimg2 = "Http://download-software.intel.com/sites/landingpage/android/sys-img.xml";
public static final string[] Repos = {repository, addon, addon6};
public static void Main (string[] args) throws Malformedurlexception,
documentexception {
BufferedWriter out = null;
try {
File File = new file ("Urlfile.txt");
out = new BufferedWriter (new FileWriter (file));
for (String Repo:repos) {
try{
Document doc = read (repo);
Findurl (Doc.getrootelement (), out);
}catch (Exception e) {
E.printstacktrace ();
}
}
Out.close ();
catch (FileNotFoundException e) {
System.err.println ("URL does not exits.");
catch (IOException e) {
SYSTEM.ERR.PRINTLN ("Error write output file.");
}
}
/* Find the <sdk:url/> tags, and get the absolute path of the file * * *
public static void Findurl (element element, bufferedwriter out)
Throws IOException {
list<?> list = Element.elements ();
for (iterator<?> its = List.iterator (); Its.hasnext ();) {
Element e = (Element) Its.next ();
if (E.getname (). Equals ("url")) {
String text = E.gettext ();
String url = "";
if (text!= null &&!text.startswith ("http")) {
url = "http://dl-ssl.google.com/android/repository/" + text;
}else{
url = text;
}
url = = "\ n";
System.out.println (text);
Out.write (URL);
}
Findurl (E, out);
}
}
public static Document Read (String fileName) throws Malformedurlexception,
documentexception {
Saxreader reader = new Saxreader ();
Document document = Reader.read (new URL (FileName));
return document;
}
}
Run Result:
Android-1.1_r1-windows.zip
Android-1.1_r1-macosx.zip
Android-1.1_r1-linux.zip
Android-1.5_r04-windows.zip
Android-1.5_r04-macosx.zip
Android-1.5_r04-linux.zip
Android-1.6_r03-linux.zip
Android-1.6_r03-macosx.zip
Android-1.6_r03-windows.zip
Android-2.0_r01-linux.zip
Android-2.0_r01-macosx.zip
Android-2.0_r01-windows.zip
Android-2.0.1_r01-linux.zip
Android-2.0.1_r01-macosx.zip
Android-2.0.1_r01-windows.zip
Android-2.1_r03-linux.zip
Android-2.2_r03-linux.zip
Android-2.3.1_r02-linux.zip
Android-2.3.3_r02-linux.zip
Android-3.0_r02-linux.zip
Android-3.1_r03-linux.zip
Android-3.2_r01-linux.zip
Android-14_r03.zip
Android-15_r03.zip
Android-16_r04.zip
Android-17_r02.zip
Android-18_r02.zip
Android-19_r03.zip
Sysimg_armv7a-14_r02.zip
Sysimg_armv7a-15_r02.zip
Sysimg_armv7a-16_r03.zip
Sysimg_armv7a-17_r02.zip
Sysimg_armv7a-18_r02.zip
Sysimg_armv7a-19_r02.zip
Samples-2.1_r01-linux.zip
Samples-2.2_r01-linux.zip
Samples-2.3_r01-linux.zip
Samples-2.3.3_r01-linux.zip
Samples-3.0_r01-linux.zip
Samples-3.1_r01-linux.zip
Samples-3.2_r01-linux.zip
Samples-14_r02.zip
Samples-15_r02.zip
Samples-16_r01.zip
Samples-17_r01.zip
Samples-18_r01.zip
Samples-19_r05.zip
Platform-tools_r19.0.1-windows.zip
Platform-tools_r19.0.1-linux.zip
Platform-tools_r19.0.1-macosx.zip
Build-tools_r17-windows.zip
Build-tools_r17-linux.zip
Build-tools_r17-macosx.zip
Build-tools_r18.0.1-windows.zip
Build-tools_r18.0.1-linux.zip
Build-tools_r18.0.1-macosx.zip
Build-tools_r18.1-windows.zip
Build-tools_r18.1-linux.zip
Build-tools_r18.1-macosx.zip
Build-tools_r18.1.1-windows.zip
Build-tools_r18.1.1-linux.zip
Build-tools_r18.1.1-macosx.zip
Build-tools_r19-windows.zip
Build-tools_r19-linux.zip
Build-tools_r19-macosx.zip
Build-tools_r19.0.1-windows.zip
Build-tools_r19.0.1-linux.zip
Build-tools_r19.0.1-macosx.zip
Build-tools_r19.0.2-windows.zip
Build-tools_r19.0.2-linux.zip
Build-tools_r19.0.2-macosx.zip
Build-tools_r19.0.3-windows.zip
Build-tools_r19.0.3-linux.zip
Build-tools_r19.0.3-macosx.zip
Tools_r22.6.2-windows.zip
Tools_r22.6.2-linux.zip
Tools_r22.6.2-macosx.zip
Docs-19_r02.zip
Sources-14_r01.zip
Sources-15_r02.zip
Sources-16_r02.zip
Sources-17_r01.zip
Sources-18_r01.zip
Sources-19_r02.zip
Google_apis-3-r03.zip
Google_apis-4_r02.zip
Google_apis-5_r01.zip
Google_apis-6_r01.zip
Google_apis-7_r01.zip
Google_apis-8_r02.zip
Google_apis-9_r02.zip
Google_apis-10_r02.zip
Google_apis-11_r01.zip
Google_apis-12_r01.zip
Google_apis-13_r01.zip
Google_apis-14_r02.zip
Google_apis-15_r02.zip
Google_apis-16_r03.zip
Google_apis-17_r03.zip
Google_apis-18_r03.zip
Google_apis-19_r04.zip
Google_tv-12_r02.zip
Google_tv-13_r01.zip
Support_r19.zip
Android_m2repository_r05.zip
Google_m2repository_r07.zip
Market_licensing-r02.zip
Market_apk_expansion-r03.zip
Google_play_services_3265130_r12.zip
Google_play_services_4323030_r16.zip
Usb_driver_r09-windows.zip
Play_billing_r05.zip
Https://dl-ssl.google.com/googleadmobadssdk/googleadmobadssdkandroid-6.4.1.zip
Https://dl.google.com/gaformobileapps/GoogleAnalyticsAndroid_2.0beta5.zip
Webdriver_r02.zip
Gcm_r03.zip
Support_r19.1.zip
6.3Android SDK 22.6.2 offline download address through the analysis of the above address, you can get the following offline download address corresponding relationship. 6.3.1 tools (must be installed)
The Android SDK Tools, Andorid SDK Platform-tools, and Android SDK Build-tools correspond to each:
Http://dl-ssl.google.com/android/repository/tools_r22.6.2-windows.zip
Http://dl-ssl.google.com/android/repository/platform-tools_r19.0.1-windows.zip
Http://dl-ssl.google.com/android/repository/build-tools_r19.0.3-windows.zip
6.3.2 Android 4.4.2 (API 19) (current latest version)
The installed portions of the Android 4.4.2 (API 19) correspond to the offline download addresses respectively:
Http://dl-ssl.google.com/android/repository/docs-19_r02.zip
Http://dl-ssl.google.com/android/repository/android-19_r03.zip
Http://dl-ssl.google.com/android/repository/samples-19_r05.zip
Http://dl-ssl.google.com/android/repository/sysimg_armv7a-19_r02.zip
Http://dl-ssl.google.com/android/repository/google_apis-19_r04.zip
Http://dl-ssl.google.com/android/repository/sources-19_r02.zip
6.3.3 Android 2.2 (API 8) (optional installation based on compatibility requirements)
The Android 2.2 (API 8) corresponds to an offline download address, respectively:
Https://dl-ssl.google.com/android/repository/android-2.2_r03-linux.zip
Https://dl-ssl.google.com/android/repository/samples-2.2_r01-linux.zip
Https://dl-ssl.google.com/android/repository/google_apis-8_r02.zip
6.3.4 Extras Android Support Library and Google USB driver must be installed.
The Android Support Library and Google USB driver correspond to offline download addresses respectively: Http://dl-ssl.google.com/android/repository/support_r19.1.zip Http://dl-ssl.google.com/android/repository/usb_driver_r09-windows.zip
7 Other
7.1 ADT22.6.2 New Android Project One more Appcompat_v7 project Appcompat_v7 is Google's own Compatibility Pack, right click on your project->properties->android, Will find in the library has import appcompat_v7, can not casually delete, after the removal of the Android project will be an error. When you build the Android application, you just have to select the minimum Required SDK to the Android 4.0 version (API 14), and you won't see appcompat_v7 content.