Try Tuts+ Premium, Get Cash Back!
Getting Started With Kindle Fire Development

Getting Started With Kindle Fire Development

Tutorial Details
  • Technology: Kindle Fire + Android 2.3
  • Difficulty: Intermediate
  • Estimated Completion Time: 45-60 Minutes

The Kindle Fire is the new touchscreen and e-book reader from Amazon. This device has generated a lot of buzz, and for good reason! It is currently the best selling Android tablet, with millions of units already sold. This tutorial will teach you how to begin making apps with the Android SDK specifically targeted for the Kindle Fire.

If you thought it would be as simple as plugging in the Kindle Fire device to your development machine via a USB cable (it doesn’t come with one) and loading your apps using the Android tools, you might be surprised to find that it’s not quite that simple — though it is close. Today, we’ll walk you through the driver configuration necessary so you can connect to Kindle Fire for debugging your Android applications. We’ll also talk about some of the ways that Kindle Fire differs from your typical Android tablet.


Part 0: Preparing for Development

Getting started with Kindle Fire development has a few prerequisites, most of them involving hardware. While these aren’t strictly required, part I focuses on items related to the hardware.

Step 1: Getting a Kindle Fire

If you don’t already have a Kindle Fire device, you’ll need to get one. Kindle Fire is cheap compared to buying most Android smartphones at full price. A typical smartphone, off contract, usually runs $600 to $800 USD (and sometimes thousands more on contract, if you count the wireless fees). Amazon’s Kindle Fire, however, is just $200 USD. Point is: it’s cheap enough to seriously consider acquiring at least one for testing purposes, even if you work independently.

Step 2: Getting a USB Cable

You’ll also need a USB cable. Kindle Fire, as a budget device, does not come with a data cable. Instead, Amazon assumes users will never connect it to a computer but rather use cloud data transfer via WiFi for all of their needs. This is great for consumers, but developers will want direct access for debugging. If you’ve got a pile of Android devices like many developers, you probably already have the right cable. Specifically, you’ll want a USB cable with a micro-B connection on one end. That’s the same connection you’ll find on the Samsung Nexus S phone, for example. It’s pretty standard fare for Android devices, especially phones.

Step 3: Android SDK

Finally, make sure you have the Android SDK installed and a development environment, such as Eclipse. You’ll want to have API Level 10 SDK installed and, if on Windows, the Google USB driver package.


Part I: Connecting to the Kindle Fire

Connecting your Kindle Fire to your computer requires some manual tweaking, whether on a Mac or a Windows machine. You’ll need to get this going before you can start loading apps and debugging directly on your Kindle Fire.

[Windows] Step 1: Editing Files

On a Windows development machine, you’ll need to edit two files and then ensure that the connected Kindle Fire device is using the correct driver. You can edit these files using your favorite text editor. Because locations vary, we’ll reference the file locations with a general description of the location, but you’ll have to ultimately find the file for yourself.

First, edit the adb_usb.ini file found in the .android folder of your user directory. Add one line to the bottom of the file:

0x1949

Second, edit the android_winusb.inf file. You may need to edit the permissions of the file before modifications will be allowed. Add the following two lines (and the comment, if you wish) to both the [Google.NTx86] and [Google.NTamd64] sections:

;Kindle Fire
%SingleAdbInterface% = USB_Install, USB\VID_1949&PID_0006
%CompositeAdbInterface% = USB_Install, USB\VID_1949&PID_0006&MI_01

Now you’re ready to plug the cable in and configure the USB driver.

[Windows] Step 2: Using the Google USB Driver

Now when you connect your Kindle Fire, your computer will be ready. Once connected, you’ll have to manually choose to use the Google USB driver. You do this from the system’s Device Manager, as with any USB device. In brief, from the Device Manager, find the Kindle device, choose Update Driver Software, choose Browse for driver, find the android_winusb.inf file, and install it. Once done, the Kindle device will show up under Android Phones, Android Composite ADB Interface.

[Mac] Step 1: Editing the ADB File

On a Mac, the process is a little different. You only need to edit one file: the adb_usb.ini file, which is found in the .android folder of your home directory. Add the following two lines to it:

0x1949
0x0006

With this, you’re ready to plug in the cable and move on to the final step.

[Mac] Step 2 & [Windows] Step 3: Restarting ADB

Once you have edited the appropriate files on either Mac or Windows, be sure to restart adb and check to see that the device now appears in the devices list when you perform the adb devices command, like so:

adb kill-server
adb start-server
adb devices

Provided your output looks something like:

Mac command line showing successful adb restart and Kindle Fire device

you should be ready to go.


Part II: Kindle Fire Development Tips

Make no mistake: Kindle Fire is a tablet device, but it does not run a tablet-optimized version of Android. Kindle Fire is an Android device, but does not run the typical Google apps nor does it have the typical Android user experience. Kindle Fire is not a phone and not really even a communications device. That is, there are many device limitations and differences to be aware of when developing and testing applications for distribution on Amazon’s Kindle Fire.

Here is a list of some tips to get you started. This list is by no means comprehensive.

Tip 1: No Google

Kindle Fire has no Google services. In particular, when developing apps make sure to use the AOSP version of the SDK — not the Google APIs version. For example, assume any Google specific intents will fail.

Tip 2: A Tablet Without Honeycomb or Ice Cream Sandwich

Amazon built the Kindle Fire OS using Android 2.3.4, Gingerbread (API Level 10). This is not a tablet-optimized version of Android. As such, to get some APIs useful for tablet development, such as Fragments, you must leverage the Android Support Package.

Kindle Fire is still a large screen device, though. Make sure your app has large screen device support marked in the manifest file and test in both portrait and landscape mode thoroughly.

Tip 3: Use Amazon Appstore for Android

As Kindle Fire has no Google services, it does not have Android Market installed. Instead, it uses Amazon’s Appstore for Android. You’ll need to publish your applications on Amazon’s Appstore and any other applications that our application integrates with must be published this way as well.

Tip 4: Limited Hardware

Kindle Fire has no camera, no Bluetooth, no microphone, no 3G radio (at least, for now), few hardware sensors, and almost no physical buttons. In fact, there’s only one button — the power button. This means several things: If your app requires any of the hardware support that Kindle Fire does not have, your app won’t work very well (if at all) on the device. Ideally, design your applications to support optional hardware features conditionally, and provide alternative behavior when the features or services are unavailable.

When it comes to in-app instructions, don’t reference the physical buttons the device does not have. It doesn’t have volume buttons. It doesn’t have physical buttons for Menu, Back, Home, etc.

Tip 5: Software Differences

The Kindle Fire OS may not look like the Android OS you’re used it. It’s got a custom user experience, with a home screen that lists the most recently used items — not just apps, but books, music, movies, etc. Users can also pin favorites to the home screen. Missing is any sort of live wallpaper or App Widget support. The top status bar can be tapped to open, but swiping down doesn’t work. Notifications will show in the tray as you might be accustomed to, but not on the status bar. Instead, just a number shows up to indicate the number of notifications. These changes simplify the user experience and serve to remind us developers that it’s a special, branded device — an ebook reader at heart — and not your vanilla Android tablet.

Tip 6: Fuzzy App Icons

If you’re loading apps through ADB or another method, you may have noticed that the app icons on the home screen are small and fuzzy compared to the apps and books that show up through the Kindle Fire interface. As it turns out, the graphics for apps and media purchased through Amazon are loaded from a web service rather than referenced from the manifest file. So, once you get your application on the Amazon Appstore, and download it via the store, your application icon graphics appear correctly.

Screen shot of Kindle Fire showing fuzzy app icon

Conclusion

Amazon’s Kindle Fire is a top selling popular Android tablet. It has no Google services and the platform has been customized by Amazon, so supporting this device may not come as easily as other Android tablets. You’ve learned how to get connected to it and have been introduced to several tips to get started developing for Amazon’s Kindle Fire. Let us know what apps you’re thinking of writing for this exciting new device in the comments!

About the Authors

Mobile developers Lauren Darcey and Shane Conder have coauthored several books on Android development: an in-depth programming book entitled Android Wireless Application Development, Second Edition and Sams Teach Yourself Android Application Development in 24 Hours, Second Edition. When not writing, they spend their time developing mobile software at their company and providing consulting services. They can be reached at via email to androidwirelessdev+mt@gmail.com, via their blog at androidbook.blogspot.com, and on Twitter @androidwireless.

Need More Help Writing Android Apps? Check out our Latest Books and Resources!

Buy Android Wireless Application Development, 2nd Edition  Buy Sam's Teach Yourself Android Application Development in 24 Hours, Second Edition  Mamlambo code at Code Canyon

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • hitansu jena

    when i press home button and again click on the application icon in the home screen ,my application starts from the first activity(i think my app restarts).But according to Android,when home button is pressed the app goes to the background saving the current status ,activity stack and resumes again where it is left on clicking of the app icon in home screen.please help.

    • http://androidbook.blogspot.com/ Shane Conder & Lauren Darcey
      Author

      Hi hitansu jena,

      Have you watched the logcat output for the state when the home button is pressed? The Kindle Fire is by no means a stock Android device. It’s possible that the app is being fully closed down when the home button is pressed.

      On the other hand, you should never rely on your app _not_ being shut down if it’s not in the foreground. There are always possible reasons why your app would be fully closed and destroyed.

  • Daniel Brauer

    This article clearly explained the basics I needed to get started with the Fire. Thanks very much!

  • Haider

    Hi,

    I am a newbie. I want to learn Mobile Development. Can Somebody guide me from initial?

  • Jason Manfield

    Do the normal Android location calls work on Kindle Fire? I believe the Kindle Fire does not have GPS; but will the network mode work (since the Kindle Fire has Wifi)?

    In my local tests, getting location with LocationManager.NETWORK_PROVIDER did not work on Kindle Fire. The same calls worked on a regular Android phone with no sim card and just Wifi.

  • http://www.singlecellsoftware.com Rej

    Thanks a lot for this tutorial, it was exactly what I needed.

  • Shlomi

    Set kindle for development
    1) echo $PATH
    verify android/tools + android/platform-tools are on your path file:

    PATH=$PATH{}:/path/droid/android-sdk-mac_86/tools:/path/droid/android-sdk-mac_86/platform-tools

    2) Add kindle to devices list:
    a) cd ~/.android
    b) open file adb_usb.ini -> if file is not exist:update your android sdk.
    c) add this 2 lines to the file:
    0×1949,
    0×0006

    3)Then ran this commands:
    adb kill-server,
    adb start-server,
    adb devices

    Thats it

  • http://www.technotalkative.com/ TechnoTalkative

    Thanx for the detailed information. Especially thanx for Tip 6.

  • Yohanna

    Does anyone have an idea how this would work with the new kindle fire hd 7 in?
    Thanks

  • Bryan

    For those looking for the android_winusb.inf file, I found mine in C:\android\usb_driver\android_winusb.inf. My Android SDK is in C:\android.

    Great helpful article, though I haven’t actually gotten through to the end yet!

  • Daniel

    Cool article. But your connection instructions are out of date. https://developer.amazon.com/sdk/fire/connect-adb.html

  • Luc Bloom

    Thanks for this excellent article.

    When running ./adb start-server, I got this output:
    * daemon not running. starting it now on port 5037 *
    ADB server didn’t ACK
    * failed to start daemon *

    Took me a while to find out what was wrong. (Though this would be helpful for others…)

    When following the steps for Mac, I made a mistake and added an extra blank line to the ~/.android/adb_usb.ini file.

    Once I removed it, everything worked fine.