標籤:android eclipse3.7 環境 搭建
這幾天實習有點空閑,偷點時間體驗android,哈哈
一直從事後台開發,所以可能對java掌握的還算不錯,對入門android也是很有協助的
android環境搭建
1、JDK、Eclipse
一般從事Java開發的朋友,都會有自己的jdk,eclipse,這裡就省略了,我這裡用的是jdk1.8,eclipse3.7
2、Android SDK
Android SDK 官方:http://developer.android.com/sdk/index.html
下載EXE安裝檔案,安裝後在安裝目錄會有一個SDK Manager.exe的檔案,點擊選擇自己想安裝的sdk版本,進行install
3、Eclipse 外掛程式ADT安裝
help-》install new software
外掛程式地址https://dl-ssl.google.com/android/eclipse/
4、配置SDK路徑
5、虛擬設備AVD安裝
windows-》Android Vitural Device Manager
具體配置可以參考一下
OK,至此android開發環境已經搭建好了
Android HelloWorld
1、建立項目
file-》new-》Android Application Project
next->next
next->finish,項目預設會添加活動MainActivity,至此項目建立完成
2、運行Android項目
Run as -》Android Application Project
記得要先建立和項目對應版本的虛擬設備AVD,比如我們這裡用的是SDK4.4
好的,這裡就看到Hello World了,而這個Activity的布局定義在activity-main.xml下
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativePackage}.${activityClass}" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /><!--這裡只是引用外部配置,你可以寫Hello World!--></RelativeLayout>
好吧,總之,Android還是挺好玩的,入門也是挺簡單的
Android環境搭建和HelloWorld編寫