2013年1月6日日曜日

Setting Up Your Kindle Development Environment

Introduction

Before you can start developing mobile apps for Kindle Fire tablets, you must first set up your development environment. At a minimum, you need to install the Java Development Kit (JDK) and Android SDK. We also recommend using Eclipse, an open-source integrated development environment (IDE).

Instructions on how to download the JDK and Android SDK (which includes a version of Eclipse) and tools required for developing applications for Kindle Fire tablets are provided below. Please note that the Android SDK, Eclipse, the Java Development Kit, and certain other development tools we reference are provided by third parties, not by Amazon. Our links for these tools will take you to third-party sites for the download and installation of the tools.


Prerequisites

Before you begin, on the Android SDK download page, click System requirements to review the minimum requirements for developing Android applications.

Note: To use the Android SDK, you must install JDK 6, which includes the Java Runtime Environment (JRE 6). Before downloading the Android SDK, we recommend installing Java SE 6 (JDK Download) from the Java SE Downloads page (under Java Platform, Standard Edition). If you are on Windows, we recommend installing the "Windows x86" binary, even if you have an x64 system.


Installing the Android SDK

  1. On the Android Developers website, follow the steps to download and install the appropriate Android SDK for your machine.

    Note: The Android SDK package includes a version of the Eclipse IDE with built-in ADT (Android Developer Tools). If you already have an Eclipse environment installed and want to add the Android SDK functionality to that environment, you can follow the instructions for installing the Eclipse ADT Plugin on the Android Developers website.

    Destination folders
    In Windows, the 
    <ANDROID_SDK> path will be:  <user-selected-directory>\adt-bundle-windows\sdk\
     
    In Mac OS, the
     
    <ANDROID_SDK> path will be:   /<user-selected-directory>/adt-bundle-mac/sdk/
    For details about the <ANDROID_SDK> path, see our 
    mapping conventions.)

  2. Once you've completed installation of the SDK, you can follow the Android documentation to launch Eclipse and start using the Android SDK Manager.

    Alternatively, you can open the Android SDK Manager from the command line by running:

    1
    $ <ANDROID_SDK>/tools/android
  3. In the Android SDK Manager window, make sure the SDK Path points to your <ANDROID_SDK> location. If not, you can change your Android Preferences in Eclipse (outside of the Android SDK Manager) as follows: from Window, click Preferences, click Android, and then update your SDK Location.
  4. In the Android SDK Manager window, from the Tools menu, click Manage Add-on Sites.
  5. In the Add-on Sites dialog box, select the User Defined Sites tab, and then click New.
  6. Enter the following URL in the Add Add-on Site URL dialog box:

    http://kindle-sdk.s3.amazonaws.com/addon.xml

  7. Select OK and then Close. (Wait for the Android SDK Manager to refresh, as indicated by the progress bar.)
  8. In the Android SDK Manager window, install the minimum installation versions of the following packages.

    Important Note: To connect your device to ADB to test and debug your app on a Kindle tablet, you must also install at least one of the Kindle SDK add-ons (emulators). We recommend installing all available Kindle SDK add-ons.

    Tip: To avoid an unnecessarily long download, make sure any packages other than those specified below are not selected (clear the check boxes for the other items that may be selected by default).

    • Tools > Android SDK Tools: version 21
    • Tools > Android SDK Platform-tools: version 16
    • SDK Platform Android 4.0.3 API 15 > SDK Platform
    • SDK Platform Android 4.0.3 API 15 > ARM EABI v7a System Image
    • SDK Platform Android 4.0.3 API 15 > Kindle Fire (2nd Generation)
    • SDK Platform Android 4.0.3 API 15 > Kindle Fire HD 7"
    • SDK Platform Android 4.0.3 API 15 > Kindle Fire HD 8.9"
    • SDK Platform Android 2.3.3 API 10 > SDK Platform
    • SDK Platform Android 2.3.3 API 10 > Kindle Fire
    • Extras > Kindle Fire USB Driver (Not applicable for Mac OS X.)
    • Extras > Kindle Fire Device Definitions
    • Extras > Android Support Library
    SDK Manager

    Figure 1. Android SDK Manager Window

    You can also select SDK Platform Android 4.0.3 API 15 > Samples for SDK and SDK Platform Android 2.3.3 API 10 > Samples for SDK, if desired.

  9. Click the Install n packages button.
  10. In the Choose Packages to Install dialog box, select the Accept All option to accept the License Agreement for all packages, and then click Install.
    Choose Packages to Install

    Figure 2. Choose Packages to Install Window

  11. Wait for the packages to install, as indicated by the progress bar. You can close the Android SDK Manager window once installation is complete.

    Note: To view and select one of the Kindle Fire devices as a target in the AVD Manager, you will need to first close and restart your AVD Manager (and Eclipse, if it is running).


Next Steps

Once you've set up your environment and created your app, you can test and debug your app two ways: by connecting your Kindle tablet to ADB to test your app on your device, or by using the Kindle Fire emulator for your device.

For more information, see Connecting Your Kindle to ADB and Using the Kindle Fire Emulators for directions on how to test your apps.


Additional Information

File Path Mapping

The Kindle Fire Development Resources documentation uses <ANDROID_SDK> and <.android_ROOT> to identify locations of specific files and applications. If you choose to use the default installation locations, you should be able to locate your file directories using the following mappings:

<ANDROID_SDK>

  • In Windows, the Android SDK directory path will be:    <user-selected-directory>\adt-bundle-windows\sdk\

  • In Mac OS, the Android SDK directory path will be:   /<user-selected-directory>/android-sdk-macosx/

<.android_ROOT>

  • In Windows, the directory path will be:   C:\Users\<your-login>\.android\
  • In Mac OS, the directory path will be:   /Users/<your-login>/.android/

Viewing Hidden Folders in Mac OS X

To enable hidden folders in Mac OS X, open a terminal shell and type:

1
defaults write com.apple.Finder AppleShowAllFiles YES

To disable hidden folders in Mac OS X, open a terminal shell and type:

1
defaults write com.apple.Finder AppleShowAllFiles NO

After applying the toggle in the command shell, you will need to do one of the following:

  • Reboot, log out, and then log back in again.
  • Restart Finder: From the Apple icon in the menu bar, click Force Quit, select Finder, click Relaunch, and then click Relaunch again.

0 件のコメント:

コメントを投稿