Chapter 20
In This Chapter
Making your app work on Amazon Fire
Finding out which features don’t work with Fire
Configuring and testing with an emulator
Uploading your app to the Amazon Appstore
For Android, Google may be the biggest game in town, but it isn’t the only one. Because Google makes every release of Android open to the public via the Android Open Source Project, many companies produce their own, custom versions of the Android source code.
One company that you may be familiar with, Amazon, chose Android to run on its devices — the Fire OS tablet and phone.
The Android‐based Fire devices can run Android apps with few or no modifications. It has no access to the Google Play Store, though, which means that if you want Fire users to be able to download your app, you have to publish it to the Amazon Appstore for Android. In this chapter, you find out how to port your application to the Fire OS and then publish it via Amazon.
Because the Fire isn’t a “true” Android device (it doesn’t use the official Google Android source code but instead uses a modified version), it doesn’t have access to any of the closed‐source Google services that you might already be using. In addition, the device itself may not have certain features that you’re accustomed to:
https://developer.amazon.com/public/apis/experience/maps
.Even without these features and services, many Android applications work on the Fire with little or no modification. If this includes your app, read on.
Much like developing on Android requires the Android SDK, developing on Fire requires the Fire SDK. Because you already have the Android SDK, installing the components necessary for Fire development is simple:
Click User Defined Sites, click New, and add the following URL: https://s3.amazonaws.com/android‐sdk‐manager/redist/addon.xml
.
Click Close, and wait for the SDK to download.
Then check the Amazon Fire Phone SDK Addon, and click Install.
After the SDK is installed, you need to modify your Gradle build file to use the new SDK.
In the build.gradle in the top level of your project (not the build.gradle in your individual app directories), change the line in bold to the following:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.amazon.device.tools.build:gradle:1.0.0'
}
}
In the build.gradle for your app, change your compileSdkVersion to the following:
compileSdkVersion "Amazon.com:Amazon Fire Phone SDK Addon:17"
Now you should be able to rebuild your project for the Fire.
If you want to develop for the Fire, you need either the Fire itself to test your app with or an emulator that can act as a surrogate. Because the 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.
If you don’t have access to a Fire, you need to create an emulator for one. Follow these steps:
Then choose Jelly Bean API level 17 for x86 devices, as in Figure 20-2.
Use the default configuration and then click Finish to create your Fire Phone AVD.
If you are using a real Fire device, you need to enable Developer Options to be able to use it with ADB on your computer. To enable Developer Options
You must tap the item at least seven times within five seconds.
On Windows, to detect the Fire phone on your development computer, you must first install a modified version of the Kindle Fire USB driver that is included with the Fire Phone SDK add‐on:
You will now need to restart ADB. In a terminal, go to ANDROID_SDK/platform‐tools and run
Windows:
Mac OS X or Linux:
You now see your Fire in the output from the adb devices command.
Publishing to the Amazon Appstore for Android is similar to publishing to the Google Play Store: You create an account, and then you may need to pay a developer fee.
Follow these steps:
https://developer.amazon.com/appsandservices
and click Sign In.Indicate whether you intend to monetize your apps.
If so, fill in the necessary details, then click Save and Continue.
Enter your app’s important information as in Figure 20-5, and click Save when you’re done.
Feel free to fill in the other optional fields such as SKU if it’s useful to you; see Figure 20-5.
Click the Description tab to set your app’s short and long descriptions, and add translations for other languages.
Click Save when you’re done (see Figure 20-7).
Click the Binary File(s) tab (Figure 20-10) to upload your app’s binary code, then click Save.
See Chapter 8 for more information about how to build and upload your app’s APK file.
The review process can take anywhere from hours to days to weeks. However, when your app launches in the Appstore, you can find it in the Amazon Appstore for Android alongside other apps as shown in Figure 20-11.
44.220.184.63