Developing Apps on Android Devices

01 May

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.



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.



15 responses to “Developing Apps on Android Devices

  1. John Donne

    10/11/2011 at 1:12 pm

    Hi, I’m sorry to bother you with something completely off-topic. I was redirected to your blog via a Google search on the words “tablet android screen distortion” because of a problem which is quite small, actually, but it’s been bothering me like crazy. Since you are obviously very knowledgeable about the Android OS, maybe you’ll be able to help me (it’s okay if you can’t or won’t, though…).

    I have recently bought a rather cheap 10.1, 1024×600-screen tablet, the Coby Kyros MID1024. I wasn’t expecting anything like an iPad or a Galaxy Tab, obviously, but what has been bothering me about it is that ANYTHING appearing on the screen (desktop, icons, pictures, videos) is slightly “stretched” width-wise (holding the tablet horizontally, the image is “squashed”, holding it vertically everything gets thinner and taller), like it happens on any LCD monitor when it’s set to a wrong aspect ratio (like 1024×768 when it should be 1024×600, for instance).

    If this was a desktop computer, it would only be a matter of finding the right graphics driver and/or correcting the screen resolution. On Android, all I can mess around with is the stupid LCD density index, which scales elements but doesn’t solve the issue.

    This tablet came with Android 2.2, and I have since reinstalled the manufacturer’s firmware, then an Android 2.3 version I’ve found on a forum. The problem I described persists. To make matters worse, despite this being a pretty popular tablet, I haven’t found ANYONE anywhere on the Net complaining about a similar issue. And a friend of mine is swearing up and down he’s had a MID1024 like mine in his hands and he actually measured the icons with a ruler and didn’t notice any distortion. He says it must be a hardware issue, but I can’t bring myself to believe that. Screen resolution problems are ALWAYS related to the OS or software, right?

    Now, my question to you is: have you ever heard anyone complaining about something similar? With Android running on a tablet like this, with a 16×9 screen, I mean. And more importantly, is there any way to “tweak” the blessed OS into presenting the correct aspect ratio on the screen? I reckon it must be either something fairly simple or totally impossible.

    Thank you very much for your time if you’ve read this far. I know I was rather long-winded, but I really wanted to describe the problem in detail, because when I tell people about it, they don’t seem to know what the heck I am talking about. Any input on your part would be greatly appreciated. Thank you very much again!

  2. hypernextandroid

    10/11/2011 at 2:32 pm

    Hi John

    Many thanks for posting but its disappointing to hear about the screen problems on you budget tablet.

    There might be a simple solution to this although perhaps you have already tried it. When installing a new version of Android OS it usually tries to calibrate the touch screen by asking you to touch points on the screen. This then sets the screen ratio etc. On the tablets we have used this is part of the setup procedure and cannot be skipped.

    After installation you might be able to recalibrate the touchscreen again. From the home screen press the Menu, select Settings, then select TouchPanel Calibration or something similar.

    The performance of some budget tablets can vary greatly and even users installing the same update can have different problems such as camera not working or USB not responding etc. We have two faulty tablets. One can debug via USB but not wireless. The other can debug via wireless but not USB. At least they both work fine apart from that.

    I tried as quick Goggle for your problem and it didn’t come up early in search.
    However, a search on these terms “Coby Kyros MID1024 touchscreen calibration” came up with quite a few links and YouTube videos.

    Anyhow, i hope you solve it and can leave an answer if you do,

    Best regards

    • John Donne

      10/11/2011 at 7:05 pm

      Hi Malcolm,

      thank you very much for taking the time to reply and try to help, and so soon. I really appreciate it immensely.

      Unfortunately, my tablet never asked for any touchscreen calibration when I installed Android, and there is no such option in its settings.

      I obviously don’t expect you to waste any more of your time investigating this problem (you’ve already been more than kind by researching it and answering me); however, if you’re interested, here’s some additional bits of information that may be useful in some way if you ever face a similar situation (or maybe they will just deepen the mystery):

      First, when I run an app called Multitouch Visual Test, it shows color circles under my fingers and identifies and displays the X and Y coordinates of any touch, and I have verified that the values the app shows range from 0 to 1023 (for x) and 0 to 599 (for y), even though the circles it shows are distorted into ellipses like everything else. That means that at some level the system interprets the touchscreen input correctly as 1024×600.

      Second… this one is the huge mystery. I used an app called Screen Resolution, which measures the screen in units called DPs (Device Independent Pixels). When I set the LCD density to 160, the app measures the screen as… that’s right: 1024×600 DPs. Now here is the mysterious part: the app displays these numbers against a backdrop of squares marked as measuring 100×100 DPs. When I actually measured these squares with a ruler, I was surprised to discover that they are shown as PERFECTLY SQUARE, and it’s not even in full screen mode. I say this is a mystery because anything else is distorted by the tablet’s screen in the way I described: text, icons, pictures, videos, wallpapers, anything, even in full screen mode. Go figure. I wish the developer of this app would create a tool that corrects the aspect ratio, because apparently he could do it…

      Anyway, thank you very much again for your time and your interest. If I ever find out the cause of this problem, or (hopefully) a solution, I’ll be sure to let you know.

      • hypernextandroid

        10/11/2011 at 8:46 pm

        Hi John

        Thank you for all the details on this and clearly you have done a lot of testing to find all these measurements. I am baffled by the results and assume something is wrong in the settings of the display mapping of the installed Android OS as your Device Independent Pixels gives the correct results. Unfortunately I’m not an expert in how the Android OS is installed or setup so can’t make any suggestions. Someone mentioned they changed their display density by editing a properties file – the post is below although I guess yours is different but it should have a similar prop file somewhere:-

        There is an experiment you could try although it would only shed light on the problem and not fix it. Our Solar System project is intended for tablets although the one on our projects page is set to stretch so as to fill the screen. However, I have built it again but used the “Fit” setting so it should scale correctly and show the planets as circles. It is below, renamed as SolarSystem3 and is a 2MB download. The reason this might interest you is that HAC builds using absolute pixels and not the usual density settings as used by the standard Android build tools. If it isn’t distorted then perhaps the Android Manifest’s screen density setting built into most apps is being interpreted incorrectly by your Android OS. If it is distorted then perhaps its something lower down in the Android OS and I’ll be even more baffled.

        I’m sure someone else out there must have your problem but its just a matter of time before their posts show up somewhere and Goggle finds them.

        Bye the way, thats a really cool app you used for testing the touchscreen – I wasn’t aware of it but have since downloaded and tried it.


  3. hypernextandroid

    10/11/2011 at 8:53 pm

    WordPress wouldn’t let me insert the link for the touchscreen prop file as mentioned above so here it is :-

    • John Donne

      12/11/2011 at 6:00 am

      Hi, Malcolm,

      let me thank you again for your interest in this matter. I’m glad to know that you liked the touchscreen test app – at least you got something good out of this, lol 😀

      I’ve read the thread about the display properties, but they are only talking about that single number which tweaks LCD density, not two figures, like we use in screen resolution, like 1024×600. Looks like the only thing you can do on Android is scaling everything up or down, but not changing the aspect ratio.

      As for your Solar System app, I am sorry to say it wouldn’t run on my tablet. I have tried to install it twice but I got the same error message: The application has stopped unexpectedly. Please try again. Too bad, I was curious to check it out.

      However, here are some more interesting facts:

      I was on the phone with a friend of mine, talking about this resolution problem, and he asked me to take a screen capture of my screen and send it to him. So I installed an app that did just that, captured some screenshots, and when I opened them on my PC, to my great surprise I found out that: 1) they didn’t have any distortion; 2) they measured exactly 1024×600 pixels; and 3) they were slightly taller than the display of my tablet. Oh, and 4) turns out the squares displayed by the screen resolution app weren’t square after all – I captured that screen too and compared it. You see, it’s a very subtle distortion, and it’s much easier to notice on circles than on squares.

      To me, this can mean only one of two things: either the screen resolution isn’t exactly 1024×600 (but then it wouldn’t make sense for the touchscreen test app to identify the correct number of points on the screen, right?), or the screen simply wasn’t designed with the correct aspect ratio, ergo, its pixels aren’t perfectly square. End of story.

      I am inclined to think, therefore, that this is an unsolvable flaw in this model’s hardware design, even though my friend has told me he couldn’t see any distortion on the screen of a tablet of the same model: he only saw that tablet for a few minutes, and he wears half-inch-thick glasses, so I wouldn’t trust his judgment on this. As I said, it’s a rather subtle distortion.

      Well, it’s a budget tablet. I might as well quit whining and shut up.

      Anyway, thank you very much for your time and your advice. Take care!

      • hypernextandroid

        14/11/2011 at 3:36 pm

        Hi John

        Thank you for the feedback on this as its been really interesting.

        Yes, regarding screens, the two number format such as 1200×1024 is what most of us are used to but Google used that single number LCD density you referred to in order to handle phones having different pixels size. I know that you know this but other readers might not.

        Its a pity the Solar System app didn’t work for you but still valuable info to help us decide why it didn’t.

        Regarding screen distortions, its amazing what we can put up with or even notice.
        Anyhow, I hope its not an insurmountable problem with your tablet. Hopefully enough users will use it and they will produce a fix for it. It just occurred to me that your tablet might connect to an external display or monitor and would that have the distortion. It sounds like you have already spent enough time on this 🙂

        All the best.


      • John Donne

        22/11/2011 at 2:17 pm

        Hi Malcolm,

        incredible as it may seem, everything leads me to believe that Coby has produced a 1024×600 display which falls out of industry standards. I have compared the tablet’s screen with the screen of a netbook I owned (also 1024×600) and the netbook’s is the same width, but slightly taller. So congratulations to Coby for having screwed up so royally.

        As for Android, I think it’s an operating system which may be in transition. It was originally developed for cell phones, as you say, aiming at maximum cross-device compatibility, so from that viewpoint it makes all sense in the world that it would have a more generic, not device-dependent, form of screen resolution setting. Plus, people are less likely to notice any distortion on a 4-inch phone display.

        However, as more and more powerful tablets are being rolled out and that kind of device seems bound to replace (at least in part) the personal computer, Android’s limitations should become increasingly more evident. I’m sure they pose interesting challenges (and headaches) for software developers like you. Personally, I think it’s kinda pointless to have a platform with a huge processing capacity, memory and whatnot if you won’t be able to fine-tune it to near perfection. But maybe that’s just me.

        Speaking of which, my 18-year-old nephew, which works with computer maintenance and was the first to point out the screen distortion to me (I wonder if I would have noticed it otherwise) says this problem affects most tablets with a 16:9 screen aspect ratio (to his knowledge, only Motorola’s Xoom and Samsung’s Galaxy Tab aren’t affected by it). When I told him no one anywhere on any forum I’ve visited has raised this issue, he said: “I’ve known techs with 10 years’ experience who can look at a screen set to the wrong resolution and say it’s fine.”

        Anyway, my tablet’s display isn’t exactly the best (like I said, it’s no iPad or Galaxy Tab), so I really don’t know if it would improve that much when adjusted to the correct aspect ratio (if that’s even possible). Since I use it mostly to read e-books, and not to watch movies or pictures, I’ve decided to put up with it and, when I have the opportunity, upgrade to something better (a Xoom, for instance, because the iPad’s OS sucks big time), since I need a display which would be less hurtful to my eyes for long reading sessions. One thing I can guarantee I won’t do again is buying a device on the Internet without having at least turned it on and handled it a bit.

        Thank you again for your continuing interest and support.

  4. John Donne

    22/11/2011 at 4:07 pm

    By the way, my tablet does have a mini HDMI port, through which it can supposedly support 1080p and 720p resolutions. I haven’t tested it yet because I don’t have the proper cable, but my 32-inch LCD TV set should support either of these resolutions without problems.

    • hypernextandroid

      27/11/2011 at 5:23 am

      I saw a post somewhere about this device that said it had some screen distortion but when plugged into a TV, the TV’s picture had no distortion.

      • John Donne

        27/11/2011 at 4:10 pm

        Really? I would love to see that post, if only to confirm at least that I’m not delusional, lol

  5. hypernextandroid

    28/11/2011 at 5:09 am

    I’m sorry but I didn’t bookmark the link. I Googled using keywords something like “Kyros MID1024 screen distortion”. Well if you are delusional then so is your nephew and some other posters on the web. I guess when Coby released the device they just ran into the deadline and didn’t have time to get the distortion fixed – perhaps they will in an update. The developers must know its there because they are experts on the device.

    • John Donne

      15/12/2011 at 6:16 am

      Hi Malcolm,

      I just want to bring you up to speed on the tablet conundrum. Here are the latest developments:

      Well, I’ve finally simply given up on my budget tablet. I sold it (cheap) and shelled out more than twice its price to buy a Galaxy Tab 10.1. The main problem with the first tablet wasn’t even the distortion thing, but the poor quality of the LCD display as a whole. Its resolution was too low for reading, and when viewed at an angle (any angle), it became darker or brighter or its colors inverted(much like most LCD monitors for desktop PCs). I have a theory that this is bad for the eyes, because each of the eyes views the display at a slightly different angle, so they don’t get exactly the same image, especially with a tablet, which is watched much more closely than an LCD monitor. Anyway, the Galaxy Tab has a 1280×800 resolution (no distortion, who-hoo!) and the image doesn’t change color or brightness even when viewed at an 85-degree angle in any direction. This time I went into the store and toyed with it before buying it (I even brought my nephew along to get his opinion). It was like trading a Volkswagen Beetle for a Porsche: the Galaxy has GPS, Bluetooth, two cameras, a much better accelerometer… So everything’s perfect now, right? Well, not exactly.

      There are some obvious limitations to the Galaxy, like the lack of a micro SD slot (it comes with 16GB of internal storage and that’s it). However, believe it or not, there is an aspect in which the Galaxy really leaves something to be desired to its poor Coby Kyros cousin: video playback, of all things. Oddly enough, despite its dual-core processor and Tegra 2 GPU, the Galaxy isn’t able to handle some videos that ran smoothly on the Kyros. But this time I found a wealth of discussions about it on several forums, and apparently there’s a solution: there is ONE, only one video player app that can handle the videos that won’t play smoothly on the Galaxy. I’ve downloaded the trial version and tested it, and it plays beautifully two MP4 large high-quality files which played very choppily on other players. The app is called Dice Player, it’s from Korea, but only the trial version is available on Android Market. The paid version was misteriously removed. According to the Korean creator, Google said there was a problem with their billing servers and they’re working to fix it. Very fishy, if you ask me.

      Anyway, like I said, I’ll use the tablet mostly for reading ebooks, and I have no complaints on that front. The Galaxy was able to handle perfectly some heavy PDF files which wouldn’t even open on the Kyros.

      Oh, I’ve tried installing the Solar System app, but it didn’t work on the Galaxy either. Sorry about that.

  6. John Donne

    20/12/2011 at 2:42 am

    Hi Malcolm,

    just a new piece of information that seems to shed some light (alas, but too late) on the distortion/poor display quality of the now-infamous Kyros MID1024, if you’re still interested. My friend Valquer owns another Kyros model (with an 8-inch screen and different aspect ratio) and still swears up and down that there’s nothing very wrong with his tablet’s display. He has shown me his device on Skype video call and, even with the low-quality of the video, I think I could see that his tablet has, indeed, a much clearer image when viewed at an angle.

    I have come to the conclusion that the 8-inch Kyros has a better display because it uses an LCD screen made for tablets, whereas with the MID1024, (my guess is) Coby had a bunch of netbook 10.1″ LCD screens lying around and decided to tailor a tablet with a screen of that size just to move them!!! It seems absurd, but it’s a possible explanation, because the look and feel of the MID1024 screen are exactly like those of a 1024×600 netbook display.

    Well, that’s it. I rest my case on this matter, lol

    • hypernextandroid

      20/12/2011 at 12:12 pm

      Hi John
      Thanks for all the info and technical details on this and I’m sure it helps others in the difficult decision of which Android tablet to buy. Its a really amazing situation as just looking through the many Android forums one can often see posts from people with supposedly the exact same hardware and model number but with different performance/problems. It just shows that before buying any tablet one should do some checks using a Search Engine to see if it truly does what one needs.
      Thanks also for the feedback on your Galaxy Tab as it helped us to with HAC.
      All the best


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: