[Kindle Fire] Walkthru - Deploying on a Test Device and Getting Ready for Store Deployment

To continue with my Walkthru series I’m going to talk about how to get your apps to test on your Kindle Fire (or other Android Devices, except for NOOK, check my other walkthru for details on that) preparing your app for deployment to the Amazon Appstore and a few other things to exepect. As with my other walkthru, I’m assuming that you’re already an Amazon Developer and you can deploy apps to the Amazon AppStore.

General Disclaimer

This is only a guide and I offer no legal or tax advice on anything and I am not held responsible for anything that should happen as a result of following this guide, including any financial loss, or damage to any property, or loss of data that you or others may incur. YOU ARE USING THIS GUIDE/WALKTHRU/TUTORIAL SOLEY AT YOUR OWN RISK.

Getting your Apps on your Kindle Fire

As with most other Android devices you need to enable your device to be able to “Install from Unknown Sources”

The quickest way to do this is to go to “Settings” then “Applications” and then check the “Unkown sources” option. There is a warning that pops up when you enable this option. I highly suggest you read it and understand that you do open your device up to the potential that you could install malicious software to it.
YOU DO THIS SOLEY AT YOUR OWN RISK AND YOU ALONE ARE RESPOSINBLE FOR ANY LOSSES (FINANCIAL / PROPERTY / DATA / ETC) THAT YOU OR OTHERS MAY INCUR BY ENABLING THIS OPTION.

Transfering the apk to your device with Install from Unknown Sources is simpler than using adb. All you have to do is either enable web sharing on your computer so your device can download the app or put your app on a site you control. Enabling web sharing on a mac is very simple, and you can follow this guide to do so. Ensure you have the proper controls in place to make sure that only people you want to be able to download your app can, if you put it out on the Internet.
YOU DO THIS SOLEY AT YOUR OWN RISK AND YOU ALONE ARE RESPOSINBLE FOR ANY LOSSES (FINANCIAL / PROPERTY / DATA / ETC) THAT YOU OR OTHERS MAY INCUR BY ENABLING WEB SHARING (OR SIMILAR FUNCTIONALLITY) ON YOUR COMPUTER OR UPLOADING YOUR APP TO THE INTERNET.

Once you have the app to somewhere you can browse to with your device, just point the devices browser to the apk file on the web site and download it to your device. Once the download is complete you just have to click the apk to install it.

If you want to go through all the trouble to use adb you can check out what I put in the NOOK tutorial, however the obvious should change, like getting the Kindle Fire Add-On site to get the drivers, and making sure the Kindle Fires’ USB 0x#### numbers are in the adb_usb.ini file.

In Summary:

  • Enable Install from Unknown Sources on your device.

  • Either upload the apk to a website you have control over, or a local web site off your computer. (This is really easy with a mac).

  • Browse to that location with the device’s browser and when it’s done downloading, install the app.

  • OR, if you’re crazy, you like headaches, and you enjoy having to tether your Kindle Fire to your computer, setup adb connectivity with the Kindle Fire.

Special Considerations for Kindle Fire

Currently the Kindle Fire has this very very pesky 20px high “soft button bar” that is always on the screen in portrait or landcaspe mode. There is nothing you can do to get rid of it, so unfortunetly you must code for it. The Kindle Fire’s resolution is 600x1024 which if you make your config.lua sized for 320x480, makes the factor of resizing at 1.875 (to get 600x900 centered depending on your config.lua). So in terms of 320x480 your 20px soft button bar is 10.6px, which we can round up to 11px of the screen that you lose because of the soft button bar.

Ansca’s Kindle Fire skin does not have this 20px high “soft button bar” and I’ve opened a defect for it - (Case 13439) Kindle Fire 20px Soft Button Bar not on Skin - if you want to track it yourself (Note to Ansca Staff - I will update this guide when Case 13439 is resolved.)

If you want to read up more on the Kindle Fire’s info you can do more research here - https://developer.amazon.com/help/faq.html#KindleFire

There are many ways you can code for this type of “annoyance” and the best way I found is to have a few variables that let you know if you’re on Android and/or on Kindle Fire as well.

[blockcode]
local config = {isAndroid = (“Android” == system.getInfo(“platformName”)), isKindle = false}
[/blockcode]

Obivously if you wanted to test your “config.isKindle” you should put the isKindle flag to true, and you can also test your “config.isAndroid” by adding “or true” after the system.getInfo evaluation. (If someone knows how to programatically find out if you’re on a Kindle, I will gladly update this part of the walkthru.)

So throughout your code you can do things like this (probably most helpful with Menu UIs and game UIs):
[blockcode]
if (config.isAndroid and config.isKindle) then
–special code for Kindle Fire
elseif (config.isAndroid) then
–Other code for just android
else
–iOS code
end
[/blockcode]

Also when you build for Kindle Fire you’ll want to make sure that if you have config.isKindle “manually set” that you set it to true.

In Summary:

  • Kindle Fire has a pesky 20px high “soft button bar” we need to code around.

  • Setup easy to change boolean variables, so you can easily code around this annoyance.

  • Test, test, and test some more on many devices to make sure things look OK!

  • Bug Asnca to Resolve Case 13439 :wink:

Getting your App Ready for Submission

You don’t have to use your own keystore / signing certs for the Corona build of the apk (I think you can use the debug ones for Amazon Appstore) but if you want to use your own keystore here’s the way to do it (I always sign my apps with my own certs.):

Here’s a quick command to generate a keystore if you haven’t done one already:

keytool -genkey -v -alias \<SOME\_ALIAS\> -keystore \<KEYSTORE\_FILE\_LOCATION\> -keyalg RSA -keysize 2048 -validity 10000 -dname "\<SOME\_LDAP\_TYPE\_NAME\>"

Obviously you’ll replace <TEXT> with something more meaningful. Here’s an example -

keytool -genkey -v -alias MyAppsKeyAlias -keystore mykeystore.keystore -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Awesome Application,O=Aweseme Game Company Name,C=US"

The keytool will prompt you for a few passwords, so you’ll want to memorize them, as you’ll need them to be able to get at the keystore from the Corona build process, or if you ever want to inspect / change the certificates.

If you want to know more about keytool and how you generate your keystore you can research that here - http://developer.android.com/guide/publishing/app-signing.html

You should also prepare a few images and movies that will be needed for you app’s submission:

App Icons - one 114x114 Icon for the Device, and one 512x512 Icon for the Site Thumbnail
Screen Shots - three to ten images that are either 480x800 or 800x480.
Promotional Images - at least one image that’s 290x140 or 512x512
Videos - at most five videos that are at least 720 pixles wide, and in MPEG-2, WMV, QuickTime, FLV, AVI or H.263 MPEG-4 format.

And finally, your APK for upload.

Once you have all this you are ready to put your app’s info on the Amazon Developer site and submit Application for approval.

In Summary:

  • Become an Amazon Developer

  • Create your own keystore

  • Build your apk with the keystore

  • Prepare App Icons / Screen Shots / Promotional Images and Videos

  • Submit your App’s Meta-Data and APK file and wait for approval

That’s all there is to it!

Good Luck and Happy Coding!

If you have questions or need help you can find me lurking on the #corona IRC channel on freenode as Tyraziel. [import]uid: 57050 topic_id: 24902 reply_id: 324902[/import]

Thanks, great read! [import]uid: 135765 topic_id: 24902 reply_id: 101064[/import]

Fantastic contribution (again!) - thank you.

Stickied :slight_smile: [import]uid: 52491 topic_id: 24902 reply_id: 101205[/import]

My 114x114 icon looks great as a favorite, but blurry in the Kindle Fire carousel. Any suggestions?? [import]uid: 46547 topic_id: 24902 reply_id: 102055[/import]

I totally forgot that I was going to add something about this. This is normal when you load apps like I’ve explained. It should look normal when people download your app from Amazon App Store. I’ll add something about this to my walkthru. Thanks for the reminder! [import]uid: 57050 topic_id: 24902 reply_id: 102083[/import]

Hi;

I got stumped by something described above. After I put an APK up on a server and then downloaded it to the Kindle (by browsing to it), the APK file was on the Kindle in the Download directory – but how does one get to the download directory on the device itself?? (Note – I could see the file when looking at the directories on Windows with the Kindle connected via USB). So I was puzzled as to actually how to do the install without rooting the Kindle.
So as an alternative, I went the adb and usb route for installing via adb. And along the way, I found the very best and accurate description of how to get the Kindle set with the right driver, etc. from a Windows setup.
The article is here:
http://www.jayceooi.com/2011/12/13/how-to-install-kindle-fire-adb-usb-driver/
And the article was the main reason I thought I’d post. [import]uid: 49442 topic_id: 24902 reply_id: 109794[/import]

There was a way to get to the application without having to root the Kindle Fire. I was borrowing one to test on, so I don’t recall what I had to do, but it wasn’t anything complex. I think you could browse to the downloads on the device and then install from there.

You could also use adb to do the installation as you’ve pasted a link to the instructions to get the driver working on Windows, thanks for posting that! [import]uid: 57050 topic_id: 24902 reply_id: 109903[/import]

This is excellent material - definitely needed.

That said, why am I getting the following error when clicking View As=>Kindle Fire on the simulator?

The KindleFire device is not available for Indie (Android) subscribers. Upgrade your subscription to get access to full functionality.

I just purchased the Android subscription, and the Kindle Fire definitely is an android device - what other license would we need to work on this?

Note: I’ve had no trouble uploading the .apk files to the actual Kindle device and running them. The only issue is that the simulator won’t display as such.

[import]uid: 151653 topic_id: 24902 reply_id: 113753[/import]

For those looking for a quick way to upload files to your Kindle Fire, I suggest WiFi File Explorer Pro:

http://www.amazon.com/Dooblou-WiFi-File-Explorer-PRO/dp/B004OZOTSQ/ref=pd_sim_mas_1

This creates a web server on the device, to which you can upload the APK file directly from your computer’s web browser, and even remotely install the file.

Great app, and only $0.99.
[import]uid: 6084 topic_id: 24902 reply_id: 113778[/import]

TozSoftware,

Rob Miracle posted a good way to identify if the device is a kindle.

[lua]
_G.isAndroid = false
_G.isNook = false
_G.isKindleFire = false
if system.getInfo(“platformName”) == “Android” then
_G.isAndroid = true
local model = system.getInfo(“model”)
if model == “Kindle Fire” then
_G.isKindleFire = true
end
if string.find(model, “Nook”) or string.find(model,“BNRV”) then
_G.isNook = true
end
end
[/lua]

Original post: http://developer.coronalabs.com/forum/2012/09/06/systemgetinfo-platformbuild
Renato
Red Beach Games
Try our new game Cut My Puzzle for free here!
[import]uid: 181011 topic_id: 24902 reply_id: 145037[/import]

TozSoftware,

Rob Miracle posted a good way to identify if the device is a kindle.

[lua]
_G.isAndroid = false
_G.isNook = false
_G.isKindleFire = false
if system.getInfo(“platformName”) == “Android” then
_G.isAndroid = true
local model = system.getInfo(“model”)
if model == “Kindle Fire” then
_G.isKindleFire = true
end
if string.find(model, “Nook”) or string.find(model,“BNRV”) then
_G.isNook = true
end
end
[/lua]

Original post: http://developer.coronalabs.com/forum/2012/09/06/systemgetinfo-platformbuild
Renato
Red Beach Games
Try our new game Cut My Puzzle for free here!
[import]uid: 181011 topic_id: 24902 reply_id: 145037[/import]

TozSoftware,

Rob Miracle posted a good way to identify if the device is a kindle.

[lua]
_G.isAndroid = false
_G.isNook = false
_G.isKindleFire = false
if system.getInfo(“platformName”) == “Android” then
_G.isAndroid = true
local model = system.getInfo(“model”)
if model == “Kindle Fire” then
_G.isKindleFire = true
end
if string.find(model, “Nook”) or string.find(model,“BNRV”) then
_G.isNook = true
end
end
[/lua]

Original post: http://developer.coronalabs.com/forum/2012/09/06/systemgetinfo-platformbuild
Renato
Red Beach Games
Try our new game Cut My Puzzle for free here!
[import]uid: 181011 topic_id: 24902 reply_id: 145037[/import]

TozSoftware,

Rob Miracle posted a good way to identify if the device is a kindle.

[lua]
_G.isAndroid = false
_G.isNook = false
_G.isKindleFire = false
if system.getInfo(“platformName”) == “Android” then
_G.isAndroid = true
local model = system.getInfo(“model”)
if model == “Kindle Fire” then
_G.isKindleFire = true
end
if string.find(model, “Nook”) or string.find(model,“BNRV”) then
_G.isNook = true
end
end
[/lua]

Original post: http://developer.coronalabs.com/forum/2012/09/06/systemgetinfo-platformbuild
Renato
Red Beach Games
Try our new game Cut My Puzzle for free here!
[import]uid: 181011 topic_id: 24902 reply_id: 145037[/import]

The keystore/keytool thing is really confusing to me. I have only released on iOS so far but now all setup on Amazon.

On iOS I download the cert and it appears on Corona but with Android am all confused.

EDIT: Also do I tick Apply Amazon DRM ?

Dave

The keystore/keytool thing is really confusing to me. I have only released on iOS so far but now all setup on Amazon.

On iOS I download the cert and it appears on Corona but with Android am all confused.

EDIT: Also do I tick Apply Amazon DRM ?

Dave