Home > Android, programming > Getting Started With Android Development

Getting Started With Android Development

Before I start off with the whole development series, I’d like to talk about how to get started with Android development and my thoughts on some parts of it. I already gave some of my thoughts on parts of it in the previous post, but I would like to expand on them.

I started with Android development early this year, deciding it would be nice to get started on this fancy smartphone thing. There are four options total if you want to get into smartphone development: iOS from Apple, Android from Google, Windows Phone 7 (WP7) from Microsoft and WebOS from Hewlett-Packard (HP). Development environments for these platforms are as follows: Objective-C, custom Java version with most of the standard Java library replaced, C#, and C++.

In terms of development ease, WP7 and iOS rank pretty high. They also feature fast and accurate emulators to test applications without having to resort to testing on a hardware device. Often the emulator is faster than the real hardware. In comparison, Android makes for a frankly rather poor showing.

The Android SDK emulator uses VirtualBox code as its base for ARM emulation, but only runs in interpreted mode, meaning that all of the virtual hardware’s registers and GPU actions are all run in software. This results in a speed penalty compared to the real hardware of between 10x and 100x. In brief this means that when it’s emulating a 1 GHz single-core ARM chip (Cortex A8 or so), the emulated speed makes it comparable to maybe 10-100 MHz. The GPU part will be even more slow, as doing OpenGL and similar operations in software is just beyond slow.

In short, this means that you won’t be using the emulator much and should basically consider it only as a bridging method until you can get your hands on a real hardware device. I got a Huawei IDEOS X5 U8800 for this reason. This is a mainstream to high-end phone, with an 0.8-1 GHz Cortex-A8 CPU, one of the better mobile GPUs currently available for smartphones. Uploading an application to it via USB and running applications on it, even the more demanding ones is painless, quick and makes using the emulator afterwards an extremely painful experience. Summarized, get a real Android device for testing 🙂

While WP7 and iOS use standard languages with standard APIs, Android is the odd one out. Knowing Java before programming for Android isn’t required and probably will just confuse you in some parts. Google thought that things like non-blocking (non-modal) dialogue windows were a good idea, meaning that you can’t ask for user input and wait for the dialogue to return. Code will be branching off all the time, ensuring that you keep having to patch up unexpected behaviours. In many ways the API feels immature and incomplete.

I have a lot of C++/Qt experience, and I must say that while similar to Android in some respects, the former is mature, feature-complete and always has new ways to make things run more efficiently. The latter needs a lot more work before it can be called mature. Considering that Android is still very new this isn’t surprising, especially with Google not investing much time and effect into it in the beginning.

Why I chose Android instead of iOS or WP7 is largely because of the costs and troubles involved in getting your applications out there. Both IOS and WP7 are very much walled gardens, with having to pay to be recognized as a developer, having to get one’s application approved before it can be sold on the single application market for the platform, and so on. Android is attractive because it’s free, open and offers the most freedom. Even if the API and tools aren’t as shiny. Android marketshare is growing the most rapidly because of this reason too, causing a big demand for Android developers.

The best IDE for Android development is Eclipse combined with the ADT plugin. This offers the best level of integration with ADB, the tool used to push applications onto a phone and retrieve data, but also with the debugger and such. There’s the IntelliJ IDEA IDE, but its level of Android integration isn’t nearly as refined.

So there you have it, a big rant from an Android developer why she dislikes the platform she develops for and why it’s still the best platform 🙂


Categories: Android, programming
  1. directxgr
    August 12, 2011 at 9:37 PM

    I agree with you, nowadays I am porting some custom J2ME softwares to Android and having non modal dialogs is a bit shocking, along with the need to take care of the onPause and onResume events (it’s my first time programming such “multitasking” system!). Now on the emulator part, AFAIK Android emulator is built around the QEMU and truly is almost useless, especially if you want to test / debug time-consuming code (it could take ages to complete!). Only viable solution, on device-debugging (that at least seems to work nicely). All in all, and after doing some programming for Symbian (pre-QT era) and J2ME, I am satisfied with Android coding, apart from the emulator. Hope they rectify it soon.

    • August 12, 2011 at 9:42 PM

      From what I have seen and heard the Google Android team doesn’t seem to be in any particular hurry to make the emulator usable, which is a true shame. I think that the x86 port of Android will become its unofficial replacement before long. Running it in VirtualBox reaches faster than native speeds already since VB does do hardware acceleration 🙂

      I really do wish they’d stop this non-modal dialogue nonsense, though. No other UI framework I’m aware of offers only non-modal and frankly it’s a real PITA to use. As for onPause and onResume… their use is questionable at times, with lots of bad advice being thrown around. Programming for Android feels kinda clumsy at times, reminding me of putting a web-based interface together built around JQuery or so 😛

      • directxgr
        August 14, 2011 at 9:24 PM

        My strategy for handling the onPause and onResume events is to close every running Handler, AsyncTask or Dialog and store their state as using “SharedPreferences”. When the application got restored by the system, I read those SharedPreferences restoring the program back to where it was by re-launching the Dialogs, Handlers and/or AsyncTasks making the user believe that nothing changed while the application was in the background. It is tiring or more precisely.. boring from developer-perspective and not anyone seems to care enough to implement it (to user frustration though!).

        I noticed that even some built-in (handset) applications do not restore properly from the background 😀 (Not to mention some third party utilities –Ok, expected).

        About the platform.. Well I agree with you, it seems immature on some things, expected tough if you consider that Google is mostly a “Search Engine” company so they lack “a developers culture” contrary to Microsoft or former Borland and their like 😉

  2. August 15, 2011 at 12:58 PM

    @directxgr Go to code.google.com and the me Google doesn’t have a developers culture.

    • directxgr
      August 15, 2011 at 1:21 PM

      Instead of visiting their web pages I am working with their software development tools and that’s from what I am going to judge them, you can talk all day about programming or writing great articles or releasing code snippets etc.. and be great doing so but.. their entire Android SDK chain still lacks heavily in quality and they must (had) address it soon. When you have a developers culture you give great attention to your SDK and you try to give a great experience to developers, Android is not there yet. It needs a better UI Designer (the latest one is very improved but still has quirks), a faster emulator (I do not care how they will address it -it’s their problem), and better out-of-the-box documentation. Anyway, I am doing my job as is right now but have worked with other great SDK/IDEs I can’t say I am positively impressed from it’s SDK as is right now, IMHO.

      • August 15, 2011 at 9:28 PM

        I agree with this assessment. The Android API is flaky at best, with lots of inconsistencies and countless gaps where functionality is downright missing. Much of the time you’re basically told to ‘implement it yourself’, like drag & drop on listviews and such fundamental things which belong on a mobile, touch-screen enabled platform. My impression of the Android API and SDK is that of a haphazardly thrown together pile of code and tools which more or less works most of the time. I know I’ll be jumping ship to WP7, iOS or WebOS if they become viable platforms 🙂

  3. directxgr
    August 16, 2011 at 6:01 AM

    “I know I’ll be jumping ship to WP7, iOS or WebOS if they become viable platforms”.
    Me too! Right now I am waiting to see what momentum will WP7 Mango handsets gain in the consumers market especially after Nokia & Microsoft present their first awaited handsets. If they gain good publicity, proper selling and rectify some minor platform drawbacks I won’t hesitate switching to WP7/C# instantly 😀

    • August 16, 2011 at 10:12 AM

      Right now the marketshare of WP7 is only about 3.6%, which isn’t very high on the ‘making me jump ship’ scale. Android is 37%, iOS is 16%. RIM takes about the rest together with Symbian 🙂

      Symbian has had its death warrant signed by Nokia, though, so its share will get redivided amongst the others, including WebOS and WP7. It’s going to be interesting to see how things will move the coming months and years 🙂

  4. August 16, 2011 at 8:34 AM

    I’m going to wait at least til ICS to write it off. Google has a history of turning things that cause huge problems into the best thing out there. Remember the first beta of Chrome? Look at how far it’s come; they made a friggin operating system out of it.

  1. August 10, 2011 at 4:13 AM

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: