Setting Up Your Kindle Fire or Emulator

If you want to develop for the Kindle Fire, you need either the Kindle Fire itself to test your app with or an emulator that can act as a surrogate. Because the Kindle Fire is its own breed of Android, you can’t use the same ADB you use with other Android devices unless you make a few configuration changes.

Creating Kindle-like emulator

If you don’t have access to a Kindle Fire, you need to create an emulator for one. The process for doing so is slightly different than it is for a regular Android emulator because the Kindle Fire runs its own version of Android. Follow these steps:

1. Install the Android 2.3.3 (API Level 10) SDK using the SDK Manager.

Check out Chapter 2 for more details on how to use the SDK Manager.

2. In the SDK Manager, choose ToolsManage Add-on Sites.

The Add-on Sites dialog box opens, as shown in Figure 18-1.

Figure 18-1: Add a SDK.

9781118417454-fg1801.tif

3. On the User Defined Sites tab, click the New button.

4. Enter the URL http://kindle-sdk.s3.amazonaws.com/addon.xml and click Close.

The Android SDK Manager dialog box opens, as shown in Figure 18-2.

Figure 18-2: Install the Kindle Fire emulator.

9781118417454-fg1802.tif

5. Scroll down to Android 2.3.3 (API 10), select Kindle Fire, and then click the Install Packages button.

6. Accept the license agreement and click Install again.

7. Open the AVD Manager and click the New button.

8. Select Target Kindle Fire (Amazon) – API Level 10.

The Create New Android Virtual Device dialog box opens, as shown in Figure 18-3.

9. Enter a name for your emulator and click Create AVD.

10. Select the 2_3_3_Kindle_Fire AVD you just created and click Start, and then click the Launch button to run your new emulator.

The Kindle Fire emulator is now running in a window. See Figure 18-4.

Figure 18-3: Name your emulator.

9781118417454-fg1803.tif

Figure 18-4: The emulator running Kindle Fire.

9781118417454-fg1804.tif

Now you can run your Android application from Eclipse in your Kindle Fire emulator.

Configuring ADB (Mac)

If you’re using a real Kindle Fire device (as opposed to the emulator), you can’t connect to a Kindle Fire directly out of the box using ADB without making a few modifications first. Follow these steps:

1. On your Mac, edit the adb_usb.ini file in the .android folder of your home directory.

Add the following lines to the bottom of the file:

0x1949

0x0006

2. Plug in your Kindle Fire and restart ADB:

adb kill-server

adb devices

You now see your Kindle Fire listed in the output from the adb devices command.

Configuring ADB (Windows)

As on a Mac, you can’t connect to a Kindle Fire device directly out of the box using ADB, without making a few modifications first.

1. On your Windows machine, edit the adb_usb.ini file in the .android folder of your home directory.

Add the following line to the bottom of the file:

0x1949

2. Edit the android_winusb.inf file.

Add the following two lines to both the Google.NTx86 and Google.NTamd64 sections:

;Kindle Fire

%SingleAdbInterface% = USB_Install, USBVID_1949&PID_0006

%CompositeAdbInterface% = USB_Install, USBVID_1949&PID_0006&MI_01

3. Plug in your Kindle Fire and, when prompted, choose to install the driver manually.

4. Browse to the android_winusb.inf file you just edited and install it.

5. Restart ADB by running the following commands in a command window:

adb kill-server

adb devices

You now see your Kindle Fire in the output from the adb devices command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset