How to build an android development environment in Windows)
I have been busy changing my project API to an API on the Android platform recently. So I want to learn more about Android. I will repost this article first.ArticleWe need to learn about Android step by step and hope to communicate with colleagues.
Link: http://blog.csdn.net/Mac_cm/archive/2009/01/06/3720492.aspx
BuildAndroidDevelopment Environment
1DownloadAndroid SDK
Http://code.google.com/android/download.html
This is the official website. Follow the process and select your own platform (here isWindows)SDKPackage download. After downloading, decompress the package and you can use it.
ToDoSDirect use on the consoleSDKTool, you can setSDKDirectoryWindowsOfPathEnvironment variable: Right-click my computer on the desktop and click Properties]>[Advanced]>Environment variable ]. Double-clickPathItem, SetAndroid SDKMediumToolsThe complete directory path is added here.
2DownloadJdk6
Http://java.sun.com/javase/downloads/index.jsp
Download and installJavaDevelopment Kit.
3DownloadEclipse3.4.1
Http://www.eclipse.org/downloads/
In theEclipse packages"Tab, select"Eclipse classic3.4.1. This is the latest version.
ForEclipseFor example, you can directly decompress the package.
4DownloadEclipseOfAndroid ADTPlug-ins
Many tutorials are passed in this step.EclipseIts ownUpdateFunction download:
StartEclipse, Select 【Help]>【Soft updates]>【Find and install...]
Select"Available Software"Tab, click 【Add site...] Button. AddUpdateSite:Https://dl-ssl.google.com/android/eclipse/
"Https://dl-ssl.google.com/android/eclipse/", Select this item, and click 【Install...] Click to download.
Note:Many Chinese users cannot complete such upgrades. Generally, the upgrade is half done without any reflection (Other plug-ins, suchPydevThe same is true ).
It doesn't matter. Let's go directlyAndroidGo to the official website to download thisADTPlugin:
Http://code.google.com/android/adt_download.html
After the download is complete, extractFeaturesAndPlugins"Copy the files in the directoryEclipse.
RestartEclipseAndroid SDKSettings:
Select 【Windows]>【Preferences...] Open the edit Properties window.
SelectAndroidProperty panel
JoinAndroid SDKDirectory (click 【Browse...Select, here is"Android-sdk-windows-1.0_r1).
SetEclipseOfJava JDKAttribute settings
Select 【Window]>【Preferences...] Open the edit Properties window.
SelectJavaProperty panel
SelectJavaThe compiler is6.0
ClickApply, AndOK.
Note:This is the step mentioned in most teaching materials. However, it is strange that I did not go through this step during installation (in fact, there is no"JavaThe compiler is6.0).
My hereEclipseThe latest version3.4.1,It may be related to it.
CreateAndroidEngineering
After the development environment is set up, let's createHello WorldProject. Try it out.AndroidDevelopment.
1Select 【File]>【New]>【Project]
2Select 【Android]>【Android Project], Click 【Next]
3Create a newAndroidEngineering
Project name (Directory Name of the Project stored in the computer):Helloworld
Package name (For more information about the package name, seeJavaRelated Concepts):Com. China. Hello
Activity name (uiClass Name of the interface window, fromActivityInherited from):Hellochina
Application name (Application title name):Test android
SuchAndroidThe project is created.
InPackage ExplorerIn the window, select 【SRC]>【Com. China. Hello]>【Hellochina. Java] File, EditCode:
PackageCom. China. Hello;
ImportAndroid. App. activity;
ImportAndroid. OS. Bundle;
ImportAndroid. widget. textview;
Public class hellochina extends activity {
/** called when the activity is first created. */
@ Override
Public VoidOncreate (bundle saveinstancestate ){
Super. Oncreate (saveinstancestate );
// Setcontentview (R. layout. Main );
Textview TV =NewTextview (This);
TV. settext ("Helloworld");
Setcontentview (TV );
}
}
Run
In theRun"Window, select"Android Application", The graph will appear in a short time.1The following figure shows the simulator window:
Figure1 androidSimulator
Click"Menu"Key to unlock, ourProgramAs shown in the figure below.2.