December 22, 2014

Android Development: It's Just Different

As Android grows in visibility, more and more developers, particularly those coming from other mobile platforms, are starting to learn Android development. For example, there seems to be a growing influx of Windows Mobile developers starting to get involved in creating Android ports of their applications.

If you are one of those people, welcome!

One problem we encounter, though, is that some newcomers seem insistent upon Android necessarily supporting whatever sort of implementation patterns they are used to from past development environments. So, we get complaints about Android lacking thread-blocking dialogs, or ways to terminate the app, or whatnot. And, sometimes, when those complaints are met with “sorry, that’s just not the way things are done around here”, those lodging the complaints get nasty.

Android development may be better than what you’re used to. It may be worse. More importantly, though, it is just plain different. This should be no surprise, since each development environment is different across the board: WinMo is different from iPhone, Ruby Web apps are different from Java Web apps, Visual Basic for DOS is different than FoxPro…

(oh, wait, I’m showing my age on that last one)

…and so on.

Whenever you start developing for a new platform, you need flexibility in your mental model, particularly if you are trying to do a straight-up port of one app to a new platform. Things that you did in the original app just may not make sense in the new environment, and trying to force the issue is only going to cause you pain. Your goal should be to deliver significantly similar business logic on the new platform, not to replicate every last button or icon. So, while people “terminate” their Windows Mobile app, they don’t really “terminate” an Android app, any more than they “terminate” a Web app.

Similarly, programming techniques you used in the old environment just might not make sense in the new one. Android, like many GUI toolkits, is highly event-driven. This means that some conveniences you may find in other platforms — such as displaying a dialog and blocking the thread that started the dialog until the dialog closes — just flat out aren’t available. Does this mean that event-driven GUI toolkits are inherently inferior? Not really. They are just different, requiring different code structures (e.g., event handlers instead of blocking threads).

Whenever you move to a new programming environment, it is important to keep an open mind and find the right balance between your design models and the approaches that are most conducive to solid apps on the platform. In this respect, Android is no different.



  • Rene

    At least there is a proper C64 environment available, no need to relearn any skills or maintain flexibility there! Just use the AWESOME power of the C64 to build for Android! All those new-age FoxPro, WinMo, iPhone and Android platforms are just temporary.

    • hazydave

      Indeed. Apple felt this technology, the C64 virtual environment, so threatened the future of the iPhone, they banned it. At least twice. That one thing kept me away from the iPhone… I try to be a party to the least amount of stupid possible in life. Thus, the DROID in my pocket.

  • http://soft.antonspaans.com Streets Of Boston

    Great advice Mark!

    I've seen those threads on support forums and at times noticed the inflexibility of trying to learn a new paradigm/framework of programming. I guess some hoped for an easy port of their app and now they have to put more work into it.

  • JustAPhoneUser

    I do not know how programming for the Iphone is, but windows mobile, windows forms, WPF, etc all use a similar architecture. Porting to linux using mono is not so bad because it is basically the same thing. Android really takes things in a different direction, which can be very frustrating. It feels like a very academic approach to software development, rather then the lets just get it done approach. I am not saying hat that is bad, but there are a lot more "i"'s to dot and "t"'s to cross, and from my experience it is a little more bug prone then winmo. At then end of the day, Microsoft is not doing much to bring customers to the table and Google is, so quit your complaining and write some awesome code!

    Speaking of C64, we need a C64 phone so that we can write our apps in assembly! Imagine how flipping fast that would be and I could then play my favorite video games! Man I miss 6502 assembly….

  • TT88

    Well said Mark .. Hear Hear …

  • James

    "Whenever you start developing for a new platform, you need flexibility in your mental model, particularly if you are trying to do a straight-up port of one app to a new platform. Things that you did in the original app just may not make sense in the new environment, and trying to force the issue is only going to cause you pain."

    Excellent point here. I've seen it many times where someone just doesn't want to do something new and different. I saw it back in the early 80s when people were introduced to C. It is nothing new. The difference between a good programmer and a mediocre one is someone who can get their head around a new way of doing things. Even better if you can do it with enthusiasm.

  • Wayne

    I am busy getting back into Java Development and want to hit the Android wagon. Let me know what you think I should develop first: http://goo.gl/kNqb

  • divide

    There was never a Visual Basic for DOS. (Youth today, making things up just to show off…)

  • http://www.sourcebits.com/ Android Development

    I think learning Android development is a lot easier.. You have almost everything here developer.android.com/

  • Phyll

    I doubt if you’re as old as I am. It still would be nice to be able to intercept the Home key.