2009年7月1日 星期三

安裝 Android 的開發環境

要進入Android世界, 首先就是要把開發環境準備好.
根據書上說明, 在我的 win xp 下, 要有下列幾項軟體工具:

1. Java Development Kit (JDK) v6.0 以上
2. Android SDK 1.0r2 以上
3. Eclipse IDE 程式.

以上3項可以分別在:
http://java.sun.com/javase/downloads/index.jsp
http://developer.android.com/index.html
http://www.eclipse.org/downloads/

中下載.

由於資訊科技日新月異, 軟體版本也更新的很快. 所以原廠提供的最新版本應該都和書上說的不同.
但因為不想冒太大風險, 所以我就盡量按照書上類似的的版本.
我採用的是:
jdk-6u14-windows-i586.exe (JDK 6 Update 14);
android-sdk-windows-1.5_r2.zip (Android 1.5 SDK, Release 2); (註:.1.1 r1好像有小問題, 先不研究)
eclipse-jee-ganymede-SR2-win32.zip (Eclipse IDE for Java EE Developers).

下載完畢後.接下來就是要安裝這些軟體:

JDK安裝還算容易, 點一點就完成了.也沒有特別修改它內定存放的目錄.
Android SDK及 eclipse 都只要解壓縮放到想放的目錄就可以了.
基本上我是放到 C:\android 及 C:\eclipse 上.

另外還要設定一下系統環境變數:
就是將 "C:\android\tools" 及 "C:\Program Files\Java\jdk1.6.0_14\bin" 加入windows系統變數的 path 中.
設定的步驟: [我的電腦] -->[內容]-->[進階]-->[環境變數]






接著就是要啟動 Eclipse.
開啟 Eclipse 不是那麼順利, 有個 error code的視窗出現. 程式沒辦法開啟. (書上沒有特別說明, 要注意些什麼是ㄚ!). 也許是因為我沒玩過 java 的開發環境也有關係.

錯誤訊息的第一行是:
JVM Terminated. Exit Code=-1.

好不容易在網路上找到解決的方式. 就是把 eclipse.ini 中的 "-Xmx512m" 改為 "-Xmx256m" .

改好後. 再次啟動就沒問題了.
進入 Eclipse 後還要做幾個設定:
剛進入時會問工作空間 workspace 的位置, 若沒問題就用內定的就好了.
Eclipse開啟後, 要先下載 Android Development Tools plugin.
下載的步驟:
[help]--> [Software Updates] --> [Available Software] --> 右邊的[Add Site]
在 Location 填寫 https://dl-ssl.google.com/android/eclipse 按 [OK] 後 Available Software 就增加選項, 再將 Android DDMSAndroid Development Tools 選擇打勾, 按[Install] 安裝.
安裝完畢後, 會要重新啟動. 這樣 ADT 就安裝啟用完成了.

在正式建立 Android 專案之前, 要先設定一下 Android SDK的路徑:
[Windows]--> [Preferences] --> 左邊選 Android --> 按[Browse..] 選擇原先放置 Android的目錄 (我的是 C:\android ).
確定後 按 [Apply] , [OK] 就完成設定了.

這樣就可以開始正式建立 Android 專案了.

17 則留言:

  1. I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
    http://www.besanttechnologies.in/digital-marketing-training-in-chennai.html

    回覆刪除
  2. Existing without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.
    href="http://www.besanttechnologies.in/digital-marketing-training-in-chennai">Digital Marketing Training in Chennai

    回覆刪除
  3. Really you have done great job,There are may person searching about that now they will find enough resources by your post
    AWS Training in chennai

    AWS Training in bangalore

    回覆刪除
  4. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
    Blueprism training in velachery

    Blueprism training in marathahalli


    AWS Training in chennai

    回覆刪除
  5. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
    java training in chennai | java training in bangalore

    java online training | java training in pune

    回覆刪除
  6. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    python online training
    python training in OMR
    python training in tambaram

    回覆刪除
  7. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 

    Devops training in sholinganallur

    回覆刪除
  8. Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...

    java training in chennai | java training in bangalore

    java online training | java training in pune

    回覆刪除
  9. Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.
    AWS Training in Chennai |Best Amazon Web Services Training in Chennai
    AWS Training in Rajaji Nagar | Amazon Web Services Training in Rajaji Nagar

    Best AWS Training Institute in BTM Layout Bangalore ,AWS Coursesin BTM

    回覆刪除
  10. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
    python training in pune | python training institute in chennai | python training in Bangalore

    回覆刪除
  11. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

    DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

    Good to learn about DevOps at this time.


    devops training in chennai | devops training in chennai with placement | devops training in chennai omr | devops training in velachery | devops training in chennai tambaram | devops institutes in chennai | devops certification in chennai | trending technologies list 2018

    回覆刪除