在Windows上搭建Android的JAVA开发环境图文教程Eclipse版本.docx
《在Windows上搭建Android的JAVA开发环境图文教程Eclipse版本.docx》由会员分享,可在线阅读,更多相关《在Windows上搭建Android的JAVA开发环境图文教程Eclipse版本.docx(12页珍藏版)》请在冰豆网上搜索。
在Windows上搭建Android的JAVA开发环境图文教程Eclipse版本
在Windows上搭建Android的JAVA开发环境图文教程(Eclipse版本)
1.下载需要用到的工具:
(1)下载JAVA的IDE开发工具–Eclipse
到Eclipse官方网站下载EcpliseForJavaEE的最新Windows版本
下载页面地址:
http:
//www.eclipse.org/downloads/
下载Ecplise
(2)下载Java开发包—JavaSEDevelopmentKit(JDK)JDK6
到Sun官方网站下载JDK6,选择JDK6Update12
下载页面地址:
下载JDK6
(3)下载Android开发包—AndroidSDK
到Google的官方网站下载Android的开发包ForWindows的
下载地址:
2.下载完需要的工具之后,开始安装
(1)安装Ecplise:
下载回来的Ecplise(eclipse-jee-ganymede-SR2-win32.zip)直接解压即可
(2)安装JDK6:
运行下载回来的JSK安装包(jdk-6u12-windows-i586-p.exe)一路”下一步”即可
(3)安装Android开发包(SDK):
下载回来的SDK包(android-sdk-windows-1.1_r1.zip)直接解压即可
3.让Ecplise自动安装Android开发插件(ADT-plugin)
(1)启动安装完(解压)后的Ecplise目录下的Ecplise.exe
(2)点击菜单”Help”->”SoftwareUpdates”,在打开的窗口中切换到选项页”AvailabeSoftware”
(3)点击”Addsite…”,加入以下地址:
http:
//dl-然后点击”OK”
(4)刚才加入的地址,点击”Install…”进行ADT(AndroidDevelopmentTools)的安装工作.
(5)Ecplise此时会从加入的地址中自动下载跟安装ADT,稍等一会,安装完毕后,提示需要重启Ecplise,点击”OK”重启Ecplise
安装ADT
4.配置AndiordSDK路径
重启完Ecplise后,点击菜单”Window”->”Preference”,打开了配置窗口,在左边选中Android,在右边输入AndroidSDK的路径(刚才步骤1-(3)下载的AndroidSDK解压出来的目录),点击”OK”,至此环境配置完毕.
配置AndroidSDK路径
5.测试开发一个Android项目
(1)点击菜单”File”->”New”->”Other…”,在打开的窗口中选择”Android”->”AndroidProject”,点击”Next”进入下一步
(2)随便起个项目名,例如”HelloWorld”,注意Packagename里需要输入”com.项目名”才能点击”Finish”继续.
新建Android项目
(3)建好项目之后,点击菜单”Run”->”Run”,在弹出窗口中选择以”AndroidApplication”模式运行程序,即可调起Android的模拟器运行测试程序了.
以AndroidApplication运行
测试Android模拟器
6.完成
至此Java的Android开发环境就搭好了,接下来的教程还会有C++的Android开发环境搭建,还有Android的进阶开发,欢迎持续关注.
ToBeContinue
本文地址:
在Windows上搭建Android的JAVA开发环境图文教程(Eclipse版本) 文章出处:
一丁点
转载请以链接形式注明原始出处和作者,欢迎转载。
++++++++++++++++++++++++++搭建GoogleAndroid2.1平台+++++++++++++++++++++++++++++++++
以下英文内容来自官网
并加上本人的中文注解
DownloadtheAndroidSDK
December2009
TheAndroidSDKhaschanged!
Ifyou’veworkedwiththeAndroidSDKbefore,youwillnoticeseveralimportantdifferences:
· TheSDKdownloadablepackageincludesonlythelatestversionoftheAndroidSDKTools.
· Onceyou’veinstalledtheSDK,younowusetheAndroidSDKandAVDManagertodownloadalloftheSDKcomponentsthatyouneed,suchasAndroidplatforms,SDKadd-ons,tools,anddocumentation.
· Thenewapproachismodular—youcaninstallonlythecomponentsyouneedandupdateanyorallcomponentswithoutaffectingotherpartsofyourdevelopmentenvironment.
· Inshort,onceyou’veinstalledthenewSDK,youwillnotneedtodownloadanSDKpackageagain.Instead,youwillusetheAndroidSDKandAVDManagertokeepyourdevelopmentenvironmentup-to-date.
IfyouarecurrentlyusingtheAndroid1.6SDK,youdonotneedtoinstallthenewSDK,becauseyourexistingSDKalreadyincludestheAndroidSDKandAVDManagertool.TodevelopagainstAndroid2.0.1,forexample,youcanjustdownloadtheAndroid2.0.1platform(andupdatedSDKTools)intoyourexistingSDK.RefertoAddingSDKComponents.
showmoreshowless
IfyouarenewtotheAndroidSDK,pleasereadtheQuickStart,below,foranoverviewofhowtoinstallandsetuptheSDK.
Platform
Package
Size
MD5Checksum
Windows
android-sdk_r04-windows.zip
23069119bytes
c48b407de852ba483869f17337e90997
MacOSX(intel)
android-sdk_r04-mac_86.zip
19657927bytes
b08512765aa9b0369bb9b8fecdf763e3
Linux(i386)
android-sdk_r04-linux_86.tgz
15984887bytes
ef84b08fd9da84f4c4ae77564fe4eaee
QuickStart
ThestepsbelowprovideanoverviewofhowtogetstartedwiththeAndroidSDK.Fordetailedinstructions,startwiththeInstallingguide.
0.Prepareyourdevelopmentcomputer
ReadtheSystemRequirementsdocumentandmakesurethatyourdevelopmentcomputermeetsthehardwareandsoftwarerequirementsfortheAndroidSDK.InstallanyadditionalsoftwareneededbeforedownloadingtheAndroidSDK.Inparticular,ifyouplantodevelopAndroidapplicationsintheEclipseIDEusingtheADTPlugin(seebelow),makesurethatyouhavethecorrectversionofEclipseinstalled.
1.DownloadandinstalltheSDKstarterpackage
Selectastarterpackagefromthetableatthetopofthispageanddownloadittoyourdevelopmentcomputer.ToinstalltheSDK,simplyunpackthestarterpackagetoasafelocationandthenaddthelocationtoyourPATH.
2.InstalltheADTPluginforEclipse
IfyouaredevelopinginEclipse,setuparemoteupdatesiteandinstalltheAndroidDevelopmentTools(ADT)plugin.Fordetailedinstructions,seeInstallingandUpdatingADT.
3.AddAndroidplatformstoyourSDK
UsetheAndroidSDKandAVDManager,includedintheSDKstarterpackage,toaddoneormoreAndroidplatforms(forexample,Android1.6orAndroid2.0)toyourSDK.Inmostcases,youwillwanttodownloadmultipleplatforms,sothatyoucanbuildyourapplicationonthelowestversionyouwanttosupport,buttestagainsthigherversionsthatyouintendtheapplicationtorunon.Informationabouteachplatformisavailableatleft,under"DownloadableSDKComponents."
TolaunchtheAndroidSDKandAVDManageronWindows,executeSDKSetup.exe,attherootoftheSDKdirectory.OnMacOSXorLinux,executetheandroidtoolinthe/tools/folder.Formoreinformationabouthowtoaddplatformsandothercomponents,seeAddingSDKComponents.
4.Getthelatestdocumentation
Ifyoudevelopwhileoffline,usetheAndroidSDKandAVDManagertodownloadthelatestdocumentationpackage.ThedocumentationcoversallversionsoftheAPIandletsyoufilteroutthoseversionsthatyourapplicationwon’tsupport.Onceinstalled,thedocumentationisalsoavailabletoyoudirectlyfromtheEclipseIDE.
5.DownloadotherSDKcomponents
YoucanusetheAndroidSDKandAVDManagertodownloadotherSDKcomponents,suchastheSDKadd-ons.AnSDKadd-onprovidesadevelopmentenvironmentforanAndroidexternallibraryoracustomizedAndroidsystemimage.Forexample,theGoogleAPIsAdd-OnletsyoudevelopanapplicationthattakesadvantageoftheGoogleMapsexternallibrary.
6.Getstartedwithanapplicationproject
Onceyou’vesetupyourSDK,thenextstepistostartanewapplicationprojectormoveexistingapplicationsintothenewSDK.
IfyouarenewtoAndroid,youcanusetheHelloWorldtutorialtogetstartedquickly.NextStepsoffersothersuggestionsofhowtobegin.Welcome!
看起来比较麻烦,对于第一次使用的人来说是比较复杂,不过这个开发平台是我遇到过最方便的一种.
0.下载安装并SDK
1.然后下载并安装Eclipsehttp:
//www.eclipse.org/downloads/
2.在Eclipse内安装ADT(AndroidDevelopmentTools)
InstallingtheADTPlugin
OnceyouhavetheEclipseIDEinstalled,asdescribedinPreparingforInstallation,above,followthesestepstodownloadtheADTpluginandinstallitinyourrespectiveEclipseenvironment.
Eclipse3.4(Ganymede)
Eclipse3.5(Galileo)
1. StartEclipse,thenselectHelp>SoftwareUpdates….Inthedialogthatappears,clicktheAvailableSoftwaretab.
2. ClickAddSite…
3. IntheAddSitedialogthatappears,enterthisURLinthe"Location"field:
https:
//dl-
Note:
Ifyouhavetroubleaqcuiringtheplugin,tryusing"http"intheLocationURL,insteadof"https"(httpsispreferredforsecurityreasons).
ClickOK.
4. BackintheAvailableSoftwareview,youshouldseethepluginlistedbytheURL,with"DeveloperTools"nestedwithinit.SelectthecheckboxnexttoDeveloperToolsandclickInstall…
5. OnthesubsequentInstallwindow,"AndroidDDMS"and"AndroidDevelopmentTools"shouldbothbechecked.ClickNext.
6. Readandacceptthelicenseagreement,thenclickFinish.
7. RestartEclipse.
1. StartEclipse,thenselectHelp>InstallNewSoftare.
2. IntheAvailableSoftwaredialog,clickAdd….
3. IntheAddSitedialogthatappears,enteranamefortheremotesite(forexample,"AndroidPlugin")inthe"Name"field.
Inthe"Location"field,enterthisURL:
https:
//dl-
Note:
Ifyouhavetroubleaqcuiringtheplugin,youcantryusing"http"intheURL,insteadof"https"(httpsispreferredforsecurityreasons).
ClickOK.
4. BackintheAvailableSoftwareview,youshouldnowsee"DeveloperTools"addedtothelist.SelectthecheckboxnexttoDeveloperTools,whichwillautomaticallyselectthenestedtoolsAndroidDDMSandAndroidDevelopmentTools.ClickNext.
5. IntheresultingInstallDetailsdialog,theAndroidDDMSandAndroidDevelopmentToolsfeaturesarelisted.ClickNexttoreadandacceptthelicenseagreementandinstallanydependencies,thenclickFinish.
6. RestartEclipse.
NowmodifyyourEclipsepreferencestopointtotheAndroidSDKdirectory:
1. SelectWindow>Preferences…toopenthePreferencespanel(MacOSX:
Eclipse>Preferences).
2. SelectAndroidfromtheleftpanel.
3. FortheSDKLocationinthemainpanel,clickBrowse…andlocateyourdownloadedSDKdirectory.
4. ClickApply,thenOK.
Done!
Ifyouhaven’tencounteredanyproblems,thenyou’rereadytobegindevelopingAndroidapplications.
如果不能在Eclipse内直接更新ADT,可以用以下方法
1. DownloadthecurrentADTPluginzipfilefromthetablebelow(donotunpackit).
Name
Package
Size
MD5Checksum
ADT0.9.5
ADT-0.9.5.zip
3372982bytes
227ec538359fbe417ccde7f0ad614a96
2. Followsteps1and2inthedefaultinstallinstructions(above).
3. IntheAddSitedialog,clickArchive.
4. Browseandselectthedownloadedzipfile.
5. InEclipse3.5only,enteranameforthelocalupdatesite(e.g.,"AndroidPlugin")inthe"Name"field.
6.