RSS

Category Archives: Android Devices

6 How To: Develop for the Kindle Fire

What is the Kindle Fire
Amazon’s Kindle Fire is a tablet computer version of their Kindle eBook reader. It runs a modified version of Google’s Android operating system so allowing users to run and source apps originally intended for Android devices.

http://en.wikipedia.org/wiki/Kindle_Fire

http://www.amazon.com/Kindle-Fire-Amazon-Tablet/dp/B0051VVOB2

http://gigaom.com/mobile/kindle-fire-helps-amazon-appstore-hits-31000-apps-in-first-year/

This article takes a brief look at using HAC(HyperNext Android Creator) to develop apps for the Kindle Fire. Before that though we mention the two traditional approaches to developing for the Kindle Fire. However, if you don’t know or don’t want to use Java then just skip this next section and go to:- HAC and Kindle development.

Kindle and Android SDKs
Amazon provides a free Kindle SDK(Software Development Kit) so developers with a good knowledge of Java and the Android APIs can create their own apps. The Kindle Fire runs a modified version of Android Gingerbread and therefore has some differences from the official Google Android Gingerbread.

It is possible to use Google’s Android SDK to develop apps for the Kindle Fire but there is some Kindle functionality that the Android SDK cannot provide.  In contrast the Kindle SDK gives the developer full access to all the Kindle Fire’s functionality such as showing and hiding the Options Bar whereas the Android SDK cannot access these Kindle specific features.

The advantage of using only the Android SDK approach is that your app can potentially run on both standard Android devices such as Xoom etc as well as the Kindle Fire and you do not have to try to keep projects synchronised with the Kindle SDK. The disadvantage is that it can be awkward to get your app to look right on the screen because the Options Bar can hide the lower part of it:-
http://stackoverflow.com/questions/9340606/

HAC and Kindle Development
Developing for the Kindle Fire with HAC(HyperNext Android Creator) is much the same as using HAC to develop for a standard Android device with just a couple of things to look out for. Note, that HAC apps know when they are running on a Kindle Fire and automatically take care of optimising the screen coverage so users don’t have content hidden by the Options Bar. HAC developers can also add a device check inside their app to see which type of Android device it is running on and so take appropriate actions.

1) Screen Sizes
The Kindle Fire screen size is 1024 x 600 pixels with 20 pixels taken by the top Status bar and 40 pixels taken by bottom Options bar. HAC built apps automatically detect screen dimensions and handle the screen drawing so the app creator just has to choose the appropriate screen settings as described below.

HAC offers 3 options for allowable screen orientation;- either portrait or landscape, portrait only, landscape only.

During the development of your app HAC offers 3 screen scaling options: none, fit or stretch. The option none is only really useful when targeting a specific device where both orientation and screen size are known in advance. The fit option keeps the ratio of the apps height to width ratio constant irrespective of which physical device it is running on or whether the screen orientation is changed. This ratio is determined from the size given to the home card. The stretch option simply stretches the app’s screen area to fully cover the usable screen area but can result in large distortion if both portrait and landscape orientations are allowed.

To setup the screen orientation and scaling, open HAC’s Your Application window via the Android menu and it should look similar to Fig 1 below:-

Setting orientations and screen scaling

Fig 1 –  HAC’s Your Application window showing app screen setup

2) Carousel Icons
Most Android smart phones and tablets have used a 2D array of icons to represent their installed apps but the Kindle Fire also has a  stylish carousel to display them in. The carousel displays the most recent apps, books etc and represents an app by displaying its attached icon . If it can’t find the correct icon it will use an app’s launcher icon although this can result in apps with low resolution  icons looking very shabby and dated.

Fig 2 below shows the carousel on a Kindle Fire although unfortunately the camera could not accurately capture the true color of the app icons.  Three of the apps are made by HAC with one having a 200 x 200 icon and the others using older 48 x 48 icons.

From left to right the apps on the carousel are:-

1 – Kindle Test with 200 x 200 icon

2 – Lunar Lander with 48 x 48 icon

3, 4, 5 – standard high res Kindle icons

6 – PreSchool Sums with 48 x 48 icon

Note that as they are PNGs their transparency works

Fig 2 – Kindle Fire carousel

HAC supports icons up to 800 x 800 pixels so allowing an app to look stylish in the Kindle Fire’s carousel. If the icon is in PNG format then transparency is supported. Note that these icons will still work on older Android devices such as the G1 smartphone because the Android system does its own scaling.

To add an icon to your app, open HAC’s Your Application window using the Android menu and assign the icon to the area highlighted by red as shown in Fig 3  below. Either drop your icon onto the icon area or else navigate to it using the Launcher button:-

Setting icon for your app

Fig 3 – HAC’s Your Application window showing launcher icon area


Summary
When designing for the Kindle Fire, just treat it as another Android Device but remember to create a higher resolution icon for it otherwise your app can look shabby and dated sitting on the carousel. Also think about which screen orientation(s) your app needs. Note, although this article has covered the Kindle Fire, the above points about screen sizes, orientations and launcher icons are still relevant to creating apps for other Android devices.

Members of HAC forums can download the latest trial version of HAC, see details here:- http://www.hypernextandroid.com/hnfiles/downloads.html

 
 

Device Roundup

HTC G1 Dream

The HTC G1 Dream is a smart-phone running OS1.6 with a 320×480 capacitive screen and a physical keyboard. Testing on a device with a physical keyboard is a must because the emulator’s soft keyboard has some problems and sometimes getting the soft keyboard out of the Chinese mode when doing API calls to it can be very awkward. Also the G1 is a good test of orientation handling as when its physical keyboard is flipped out an orientation change to landscape is signalled by the OS. Note, G1’s generally don’t come with an SD-Card and one must be fitted for HAC apps to run on it.

HTC Hero

The HTC Hero is a smart-phone very similar to the H1 except it runs OS2.1update 1 and has no external keyboard. It also has a 320×480 capacitive screen and more RAM at 288MB compared to 192MB on the G1 . Both the G1 and Hero use a 528MHz processor.

HiPad IMX515

The HiPad IMX515 is a tablet usually running OS 2.1 although it can be upgraded to OS2.2. It has a 800×600 resistive screen, 512MB RAM and an 800MHz processor. USB seemed to run well on OS 2.1, but after updating to OS 2.2 our USB no longer works reliably necessitating the use of wireless ADB debugging.

EPAD 10

The EPAD 10″ Wireless tablet uses OS2.2 and has 1024×600 resistive screen. It use a 1GHz processor and has 512MB RAM. For input it can use an external USB keyboard and mouse. Ours has problems with USB debugging as apparently there are no USB drivers for it yet, but wireless debugging is very reliable.

Debugging and ADB Connectivity

For the Android developer the main issue is of getting one’s apps to run under ADB on the device so they can be debugged by the debugger. Unfortunately, many devices have poor or non-existant USB debugging so for them the only option is to use wireless debugging and for this some of them must be rooted (either fully or partially).

Both HTC devices have excellent USB debugging, although they lack wireless. On the other hand, our two tablets have poor or non-existant USB debugging, but wireless debugging works very well for them.

Conclusions

If you are serious about the quality of your app then you need to test on at least one Android device. Which device you need depends upon the functionality of your software. Our G1 has serious problems playing most media, but is great for many other things, including testing keyboard functionality. Our tablets have large screen areas and can show how your app will scale up from a smart-phone screen. As our tablets use newer Android OS they are more likely to play the media you need and also offer greater OS functionality. All our Android devices are budget buys from eBay, but once you start developing on an Android device then the emulators seem very slow and archaic even though they are still a must for testing purposes.

If you could only afford one device then a tablet covers most options as in HAC you can set your card/screen size to say 320×480 and use the unscaled option that employs absolute pixels so the card appears as smart-phone size. HAC also has fit option to scale proportionally your card so it appears in the centre of the screen. The last display option is stretch, which fills the entire screen. The distortion can be unsightly, however.

There is a lot to consider when buying an Android device but hopefully this very short blog might help when you look for that bargain on eBay or you hit the high street.

 

Tags: , , , ,

Developing Apps on Android Devices

Work on HAC is progressing nicely and its being tested on both Emulators and Android devices. To make sure it works and gives us no unpleasant surprises we currently test builds on four different Android devices with more coming soon.
We chose a variety of devices running versions of Android from 1.6 to 2.2 although for OS 2.3 and later we currently just use the emulator. Official Android statistics show that few people are now using devices operating OS 2.1 and lower but we found on eBay that there are still many people buying smart-phones such as the G1 which uses OS 1.6. These older smart-phones are still an excellent way to start out developing your Android apps even though they miss out on later functionality like media playing.

It is really essential to use at least one Android hardware device because the emulators although excellent do have their problems notably very slow with some graphics/media and awkward with keyboards.

 

Device Roundup

The HTC G1 Dream is a smart-phone running OS1.6 with a 320×480 capacitive screen and a physical keyboard. Testing on a device with a physical keyboard is a must because the emulator’s soft keyboard has some problems and sometimes getting the soft keyboard out of the Chinese mode when doing API calls to it can be very awkward. Also the G1 is a good test of orientation handling as when its physical keyboard is flipped out an orientation change to landscape is signalled by the OS. Note, G1’s generally don’t come with an SD-Card and one must be fitted for HAC apps to run on it.

The HTC Hero is a smart-phone very similar to the H1 except it runs OS2.1update 1 and has no external keyboard. It also has a 320×480 capacitive screen and more RAM at 288MB compared to 192MB on the G1 . Both the G1 and Hero use a 528MHz processor.

The HiPad IMX515 is a tablet usually running OS 2.1 although it can be upgraded to OS2.2. It has a 800×600 resistive screen, 512MB RAM and an 800MHz processor. USB seemed to run well on OS 2.1 but after updating to OS 2.2 our USB no longer works reliably necessitating the use of wireless ADB debugging.

The EPAD 10″ Wireless tablet uses OS2.2 and has 1024×600 resistive screen. Its use a 1GHz processor and has 512MB RAM. For input it can use an external USB keyboard and mouse. Ours has problems with USB debugging as apparently there are no USB drivers for it yet but wireless debugging is very reliable.

 

Debugging and ADB Connectivity

For the Android developer the main issue is of getting one’s apps to run under ADB on the device so they can be debugged by the debugger. Unfortunately many devices have poor or non-existent USB debugging so for them the only option is to use wireless debugging and for this some of them must be rooted(either fully or partially).

Both HTC devices have excellent USB debugging although no wireless. On the other hand our two tablets have poor or non-existent USB debugging but wireless debugging works very well for them.

 

Conclusions

If you are serious about the quality of your app then you need to test on at least one Android device. Which device you need depends upon the functionality of your software. Our G1 has serious problems playing most media but is great for many other things including testing keyboard functionality. Our tablets have large screen areas and can show how your app will scale up from a smart-phone screen. As our tablets use newer Android OS they are more likely to play the media you need and also offer greater OS functionality. All our Android devices are budget buys from eBay but once you start developing on an Android device then the emulators seem very slow and archaic even though they are still a must for testing purposes.

If you could only afford one device then a tablet covers most options as in HAC you can set your card/screen size to say 320×480 and use the unscaled option that employs absolute pixels so the card appears as smart-phone size. HAC also has fit option to scale proportionally your card and have it appear in the centre of the screen. The last display option is stretch which fills the entire screen but the distortion can be unsightly.