2013年11月2日 星期六

Get started developing for Kindle Fire On Mac OS X

since: 2013/11/02
update: 2013/11/02

reference:
1. Amazon Mobile App Distribution Program
2. Kindle Fire Development Essentials - Techotopia
3. I touchs: Seting up an Android Development Environment
4. I touchs: Installing the Android SDK on the Mac OS X
5. I touchs: Setting Up the Android Device for Development on Windows7

A. Setting Up Your Development Environment
    1. Installing the JDK:
        終端機 > $ java -version
                        java version "1.7.0_45"
                        (至少需要 JDK 6)

                     > 下載 JDK: Java SE Downloads

    2. Installing the Android SDK and Eclipse IDE:
        在此使用 Android SDK bundle: Android SDK | Android Developers

         其中已包含了:
         Eclipse + ADT plugin
         Android SDK Tools
         Android Platform-tools
         The latest Android platform
         The latest Android system image for the emulator


         ---------------------------------------------------------------------------

         目前檔名: adt-bundle-mac-x86_64-20131030.zip
         存放位置: /Lanli/RD/sources

         安裝:
         $ cd /Lanli/RD/IDE/
         $ unzip /Lanli/RD/sources/adt-bundle-mac-x86_64-20131030.zip

    3. 打開 eclipse:

        /Lanli/RD/IDE/adt-bundle-mac-x86_64-20131030/Eclipse.app


     > 系統偏好設定 > 安全與隱私 > 一般 :

     > 再打開一次, 並選擇 workspace:

     > ADT > 偏好設定 > General > Workspace:
        Text file encoding >  Other: UTF-8 > OK

    4. Installing SDK Add-Ons:
        a. ADK > 偏好設定 > Android > SDK Location > OK

        b. ADK > Window > Android SDK Manager:
            > Tools > Manage Add-on Sites...

            > User Defined Site > New... >
               輸入: http://kindle-sdk.s3.amazonaws.com/addon.xml > OK > Close

        c. 在 Android SDK Manager 中, 勾選以下的套件:
            備註: 如果你傾向於使用實體的 Kindle Fire 平板來測試 app 而不想使用模擬器, 
                      你仍然必須選取其中之一的套件作為 Kindle Fire system images. 每個
                      Kindle Fire 套件包含用來識別不同的實體 Kindle Fire 平板作為測試與除錯
                      使用的 Android Debug Bridge (ADB).

            Tools:
            Android SDK Tools (install the latest version)
            Android SDK Platform-tools (install the latest version)

           Android 4.2.2 API 17:
           SDK Platform
           ARM EABI v7a System Image (emulator prerequisite for ARM system images)
          Intel x86 Atom System Image (emulator prerequisite for x86 system images)
          Kindle Fire HD 7" (3rd Generation) (ARM and x86 system images for emulator)
          Kindle Fire HDX 7" (3rd Generation) (ARM and x86 system images for emulator)
          Kindle Fire HDX 8.9" (3rd Generation) (ARM and x86 system images for emulator)

          Android 4.0.3 API 15:
          SDK Platform
          ARM EABI v7a System Image (emulator prerequisite for ARM system images)
          Intel x86 Atom System Image (emulator prerequisite for x86 system images)
          Kindle Fire (2nd Generation) (ARM and x86 system images for emulator)
          Kindle Fire HD 7" (ARM and x86 system images for emulator)
          Kindle Fire HD 8.9" (ARM and x86 system images for emulator)

          Android 2.3.3 API 10:
          SDK Platform
          Intel x86 Atom System Image (emulator prerequisite for x86 system images)
          Kindle Fire (ARM system image for emulator)

            Extras:
            Kindle Fire Device Definitions
            Kindle Fire USB Driver (not applicable for OS X)
            Android Support Library
            Intel x86 Emulator Accelerator (HAXM) (emulator prerequisite for x86 system images)
            Amazon AVD Launcher

            > 按下 "Install xx packages..."
            >  Choose Packages to Install:
                分別選取不同分類的 Packages, 並點選: Accept License
            > Install
            > 安裝完成後, 關閉 Android SDK Manager.

----------------------------------------------------------------------

B. Installing and Running the Amazon AVD Launcher
     1. 啟動 Amazon AVD Launcher:
         $ cd /Lanli/RD/IDE/adt-bundle-mac-x86_64-20131030/sdk/extras/amazon/AVDLauncherMacOSX

         $ ./amazonavd

         > 當出現 "SDK path verification" 視窗, 瀏覽到正確的 Android SDK 位置後,
            按下 "OK".

     2. 在 Amazon AVD Manager 視窗中, 選擇要模擬的設備, 接著按下 "Create AVD".

     3. 在 "Main Settings" 頁籤, 設定 AVD 名稱, 並選取 Use Host GPU 以增進效能.

     4. 切換到 "Advanced Options" 頁籤, 調整以下設定:
         Keyboard: My computer keyboard
         Skin: No skin
         > 按下 "OK".

     5. 在 Amazon AVD Launcher 的 "Amazon AVDs" 頁籤中, 點選所要啟動的 AVD,
          按下 "Start..." 即可啟動.
    備註: 之後亦可在: AVD > Window > Android Virtual Device Manager 中啟動 AVD.

----------------------------------------------------------------------

C. Creating Your First Kindle Fire App
     1. 開啓 Eclipse > ADT > File > New > Android Application Project:
         設定以下項目:
         Application Name: HelloKindleFire
         Minimum Required SDK: API 10: Android 2.3.3 (最小支援 Kindle Fire 的 API)
         Target SDK: API 17: Android 4.2 (至少要 API 15, API 17 為目前支援 Kindle Fire 的最大 API )
         Compile SDK: API 17: Android 4.2 (至少要 API 15)
         Theme: None

     2. Next > Next > Create Activity: Blank Activity > Next

     3. 設定以下項目:
         Activity Name: HelloKindleFireActivity
         Navigation Type: None
         > Finish 

     4. Run > Run Configurations...

     5. 點選專案 > Run > Run As > Android Application

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。