Eclipse配置Android_第1頁
Eclipse配置Android_第2頁
Eclipse配置Android_第3頁
Eclipse配置Android_第4頁
Eclipse配置Android_第5頁
已閱讀5頁,還剩24頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、全程演示an droid開發(fā)環(huán)境的搭建過程,無需配置環(huán)境變量。所有軟件都是寫該文章時最新 版本一相關下載(1) java JDK 下載:進入該網頁:(或者直接點擊下載)如下圖I a rv出附春弟JDK 6 Update 19 (JDK or JRE)This release contains critical security updates to the Java runtime. Piease update now to take advantage of these enhancements. n Learn moreWhat Java Do I Heed? You must have

2、a copy of the J RE (Java Runtime Environment) on your system to run Java applications and applets. To develop Java applications and applets, you n eed the J OK (Java Development Kit): which includes the J&ENOTE The Firefox 3.6 brow aer requires Java SE 6 Update 10 or later. Otherwise, Javabased

3、web applications will 訶 worKDownkiad JDKDocs DownloadDu us 選擇Download JDK 只下載JDK,無需下載jre.(2) eclipse 下載進入該網頁:/downloads/(或者直接點擊下載:BT下載 HTTP下載)如下圖:Eclipse PackagesProjectsDevelopment BuildsGalileo Packages (based on Eclipse 3.5 SR2; - Compare PackagesiEclipse IDE for Java EE Deve

4、lopers (190 MB)Tools for Java dewelopers creating Ja'3 EE and wed applications, incfuding a Java IDE. tools for Java EE, J PA, J8F, Mylyn and others. More,Downloads 868,089Windows 32bMac Carbon 1 Mac Cocoa BLinux 32bit *xEclipse IDE for Java Developers (92 MB)The essential tooisfor an/Java devel

5、oper, including a Java IDE, a CVS dient XhIL Editor an<5 Mylyn. More.Downloads: 25Bt541Windows 32bMac Carbon 1Mac Cocoa 3; Linux 32bit fJrf-Eclipse IDE for C/C+ Developers (79 MB)An IDE for C/C+ developers with M/lyn integration. More.Downloads: 130d736Windows 32b Mac Carbon - Mac Cocoa 3j Linux

6、32bit fEclipse for PHP Developers (139 MB)Tools for PHP developers creating .Vet) applications, including PHP Development Tools (PDT), Web Tools Platform. My5yn and others More.Downloads: 103,015/Vindows 32b Mac Carbon : Mac Cocoa 3: Linux 32bit f我們選擇第一個(即 eclipse IDE for java EE Developers)下載 An dr

7、oid SDK說明:An droid SDK兩種下載版本,一種是包含具體版本的SDK的,一種是只有升級工具,而不包含具體的SDK版本,后一種大概20多M,前一種70多M。完全版下載(android sdk 2.1 r01)升級版下載(建議使用這個,本例子就是使用這個這里面不包含具體版本,想要什么版本在Eclipse里面升級就行)二軟件安裝(1) 安裝jdk 6u19安裝完成即可,無需配置環(huán)境變量(2) 解壓eclipseeclipse無需安裝,解壓后,直接打開就行(3) 解壓an droid sdk這個也無需安裝,解壓后供后面使用最終有三個文件夾,如下圖::夸計算匸本堀藝孟;(印¥

8、Android 朋 包含到庫申*共事.新建文狛決燔改日期2010/4/3 12:1S2010/4/3 12:12文樣裘2010/4/2 19:16名稱尋下截真園最近訪問的位jndroid-sdk_r04-windows &clipse-jee-galileQ-SR2'Win32lzipI - -| jdk'6ul9'windcw£-i586.exeM庫Q視頗fc-窮片列文檔 崗迅雷下載奩樂礙家庭組>計帥化 windows 7 (C口(D:)l “ program anc._,本地逸(F:).,j(G:J開發(fā)與學習(L歡詩娛樂(J:Roamingm

9、個對象Eclipse酉己置1安裝an droid開發(fā)插件(1)打開Eclipse,在菜單欄上選擇help->lnstall New Software 出現(xiàn)如下界面Availablle SoftwareSelect a site or enter the location of a site.Work with:Find more software by working with the Azflilablatype After textNameVersion(jJ There is no site selected.Detailsi Hide items that are already

10、 installedWhat is 制飛3古 inMIed?7 Show only the latest versions of available softwarey Group items by categoryJ Contact all update ites during install to find required software運 Add SiteName:AndroidLocal.Locations https:/dl-ssf,googlexam/android/edipse/Archive-.OK輸入網址:https:/dl-ssl.google.eom/android/

11、eclipse/ http)(如果出錯,請將https改成名稱:An droid (這里可以自定義)點擊0K,將出現(xiàn)如下界面 InstaH點擊Next按鈕,出現(xiàn)如下界面 InstaHAvailable SoftwareCheck the ftems that you wish to install.Work with: Android - httpst/dl-ssl.googlexom/androfd/eclipse/Find more software by working with the ZUmil日ble>監(jiān) Android DDMS0.9.6.v201002051504-248

12、464 <. - Android Development Tool 0.9v201002051504-24846點擊Next按鈕,出現(xiàn)如下界面 InstaH點擊Next按鈕,出現(xiàn)如下界面 InstaHi Hid? items that are already installedWhat is ahemcJjDetails/ Show only the latest versions of available softwareJ Group items by categoryJ Contact all update ites during install to find required

13、softwareNext >Install DetailsReview the items to be installed.點擊Next按鈕,出現(xiàn)如下界面 InstaH點擊Next按鈕,出現(xiàn)如下界面 InstaHName參 Android DDMSr Android Development ToolsVersion Id0.9.6.v2.,. com.android.fde.eclipseddms.feture.,.0.9h6,v2. com,android.Ede.eclipse.dt,featjreHgr,點擊Next按鈕,出現(xiàn)如下界面 InstaH點擊Next按鈕,出現(xiàn)如下界面 I

14、nstaHSize: UnknownDetails點擊Next按鈕,出現(xiàn)如下界面Install選擇 I accept the terms of the license agreements點擊Next,進入安裝插件界面InstallReview LicensesLcenses must be reviewed before the sofhvare can bm installed. This includes icenses for sofhvare required to install.Items with licenses:License text:NameVersionJ>.-

15、 Android DDMS0.9.6.V2CHD02051504-24B46Android Development Toolsv Mylyn Bridge: Eclipse IDE站.Myiyn Bridge;ava Deveopment-y = Mylyn Bridget Team Support 樂 Mylyn Connector: BugzillaMylyn Task List (Required)< Mylyn Task-Focused Interface (Rec». .Mylyn WikiText0,9.6.v201002051504-243433J.v201003

16、3(-0100-e3x3.3.3. v201Q0330-0100-e3x3.3.3. v20100330-0100-e3x3.3.3.v2D100330-01D03x3.3.3.v201003300100-e3x333.v20100330-0100-e3x1.2. l.v2010D2 2 2-0100-e3xNote: jcomnnan'lbO.12jar is undei than the APL You can find a copy http:/wvw. pe nsciLirx:F.cirg/litFnsEjfreechjrt-l.O.S.jar Bnd jfreechari t

17、he LG PL rather than the APL You LG PL at h-?: p:/jvww. g n . rg/l i c e r s t NLtxt You can get the source co( components at http:/android,gitkemeLorg/pub/jApache LicenseVersion 2.0r Janhttp:/A/w.apach<TERMS AND 匚ONDmONS FOR AMD DISTRIBUTION1. Definitions.1 accept the terms of th聲 license o I do

18、 not accept the term5 of thtNoct >選擇 I accept the terms of the license agreements點擊Next,進入安裝插件界面安裝完成后,出現(xiàn)如下界面點擊Yes按鈕,重啟 Eclipse2 配置 an droid sdk(1)點擊菜單window->preferences,進入如下界面畫 Preferencestype filter textGeneralAndroidBuildDDMSLaunchLog CatUsge StatsAntData ManagementHelpInstall/UpdateJavaJav

19、a EEPlug-in DevelopmentRemote Systems Run/DebugServerAndroid3 于 * Android PreferencesSDK Location: F:AndroidandrcId-dk_r04'window5androSd-sBrowse.,Note: The list of SDK Targets below is only reloaded once you hit 'Apply1 or 'OKTasksTeamTerminalUsage Data Collector nrRestore DefaultsApply

20、OKCancel選擇你的an droid SDK解壓后的目錄,選錯了就會報錯,這個是升級工具,目前還沒有 一個版本的SDK(2)升級 SDK 版本,選擇菜單 window->Android sdk and avd manager出現(xiàn)如下界面F. q Android SDK and AVD ManagerF. q Android SDK and AVD ManagerVirtual Device?Installed PackagesAvailable PackagesSDK Location: F:Androidand raid-sdk_r04-windowsan droid-sdk-wi

21、ndowsInstalled PackagesAndroid SDK Tools, revtsLon 4DescriptionUpdate All.選擇update all按鈕,出現(xiàn)如下界面PackagesX Android SDK Tools, revision 52 SDK Platform Android 2.1. API 7, re,., v* Samples for SDK API 7, revision 1X Google APIs by Google Inc,. Android X SDK Platform Android 2.0,1, API 6,X Googte APIs b

22、y Google Inc, AndroidX SDK Ratform Android 2.0, API 5, re,., X Google APJs by Googl? Inc., Anciroi.X SDK Platform Android 1.6, API 4, remSiomething depends on thi-;Package Description & LicenseAndroid SDK Tools, revision 5This update will replace revision 4 with revision 5.Airhivo DgruriiHionArc

23、hive for WindowsShe: 22 MiBSHA1: 13d4f033d2637bfec85bb45cflcl623c33127d93InstallAct選擇左邊的某一項,點擊accept表示安裝,點擊reject表示不安裝,我這里只選了 SDK 2.1 和samples for api 7,自己可以任意自定義,確定后,選擇in stall按鈕,進入安裝界面如下安裝完成如下:(3)新建 AVD(a ndroid vitural device)禾口上面一樣,進入an droid sdk and avd man ager,選 中VituralDevices在 點 擊New按 鈕Virt

24、ual DevicesInstalled Packages Available PackagesAVD NameTarget NamePlatformAPI Level一No AVD available-List of existing Android Virtual Devices:Android SDK and A;D ManagerV A valid Android Virtual Device.X An Android Virtual Device that failed to load. Click 'Details' to see the error.點擊New按鈕

25、后,進入如下界面Create new AVD名稱可以隨便取,target選擇你需要的SDK版本,SD卡大小自定義,點擊Create AVD,得 到如下結果畫 Android Virtual Devices Managerof creating AVD 'AVD2.11:Created AVD 'AVD2.1' based on Android 2.1, with the following hardware config:hw. led. density=160OK如上顯示創(chuàng)建AVD完畢3新建An droid項目(1)選擇菜單file-new->other進入如下

26、界面回Select a wizardWizards:type fibter text業(yè) Java Project from Existing Ant Buildfile"1 盅 Plug-in Project l> 冷 General / & AndroidAndroid ProjectLJjf1 Android Test Project 陸 Android XML Ale、匚onnection Profilest>CVSEclipse Modeling Framework u a)< BackNext >FinishCancel選擇新建An droi

27、d Project項目,點擊 Next按鈕,進入如下界面New Android ProjectNew Android ProjectCreates a new Android Project resource.Project name: AndroidTest匚 cntents* Create new projert in workspaceCreate project rom existing source/ Use default location名稱自定義,應用程序名自定義,報名必須包含一個點以上,min SDK version里面必須輸入整數(shù)點擊Next出現(xiàn)如下界面名稱自定義,應用程序

28、名自定義,報名必須包含一個點以上,min SDK version里面必須輸入整數(shù)點擊Next出現(xiàn)如下界面名稱自定義,應用程序名自定義,報名必須包含一個點以上,min SDK version里面必須輸入整數(shù)點擊Next出現(xiàn)如下界面名稱自定義,應用程序名自定義,報名必須包含一個點以上,min SDK version里面必須輸入整數(shù)點擊Next出現(xiàn)如下界面/.匚 re ate Activity:Package name:Properties Application name:Min SDK Version:三 Rackf'1Next >finrsh jCancel名稱自定義,應用程序名

29、自定義,報名必須包含一個點以上,min SDK version里面必須輸入整數(shù)點擊Next出現(xiàn)如下界面遂 Java AndroidTest/gen/Android/Test/R.javaFile Edit Refactor Run Source Navigate Search Project Window Help:fj 百. a & Jv d 菇曲 G 出 AndroidTest'srcD Android 2.1gen Generated Jav3 FilesassetsresAndroidManifest.xml國 defaultproperties口釦3-寫 Packag

30、e E乜 Hierarchy%&&&E R.java*7* AUTO-GENERATED FILE.package Android.Test;public final class R DO NOT MODIFY.class attr public static finalpublic static finalpublic static final int Icon=0x7f020000;class drawable public static final class layout public static final int main=0x7f030000;publi

31、c static final class string public static final int app_nazEe=0x7f040public static final int hex2o=0x7f040000凰 Problems 廠 Javadoc Dedwatkm貝 ConsoleAndroid2010-04-03 13:06:17 - AndroxdTesc R.java was remoAndroidTest注: 若有錯 誤女口 : Project . is missing required source folder: 'gen',貝U 將 gen->A

32、ndroid.Test->R.java這個文件刪掉,Eclipse會為我們重新生成這個文件,并且不會報錯。(3) 配置運行右鍵項 目 ->R un as -> Run Con figuratio n 進 入如下 界面:爸 Run Configurationstype filter text互 Android ApplicationJ Android Target:. CommonAPPCreate, manage and run con figurationsAndroid ApplicationName: New_configuration苗 Newconfiguration j活 Android JUnit: Test Apache Tomcat Eclipse Application t 4 Eclipse Data Tools Generic Server Generic ServerExt亡rru HTTP Preview J2EE Preview呵 Java Applet 工 Java Application Ju JUnitJu JUnit Plug-in Test 出 OSGi Framework Task Context TestX XSLFilter matched 17 of 17 itemsRun該界面,點擊Brows

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論