NewsTips & Tricks

Google Shows Developers How to Use Multithreading for Performance

15

As much as we’d like to believe that every developer who downloads the Android SDK will grasp every concept they need to for good programming practice, some market apps have proven time and time again that there are still quite a few publishers that don’t respect the scarce resources that comes along with an Android phone (or any phone in comparison to a fully fledged computer).

gd2

Google’s  Gilles Debunne shows developers how you can use Android’s multithreading framework and asynchronous tasks to get the most out of what you need from the platform while still allowing other tasks (either within your app or – in some cases – in any other app) to go about their work.

Quentyn Kennemer
The "Google Phone" sounded too awesome to pass up, so I bought a G1. The rest is history. And yes, I know my name isn't Wilson.

Samsung Galaxy 3 i5800 to Arrive in Germany for 299 Euros Late July

Previous article

Vodafone Nexus One Upgrade to Android 2.2 FroYo Coming This Week, Hotspot and Tethering Intact

Next article

You may also like

15 Comments

  1. well at least it’s better than getting rejected without a reason….

    does android sdk have a complier of some sort to tell you how well or how poorly it’s consuming resources? i’m not by any sort a software developer by a long shot.

  2. @Inspiron41
    yes it does have some sort of speed/performance tracer that allows you as well to keep an eye on the memory consumption

  3. Ew, mooseknuckle! =(

  4. There was a really good one a few days ago about developing for multiple API’s in a single code base. Sure its a little extra code but not that difficult of a concept for developers with a good understanding of their craft. I’d figured there was a way to do it but since I haven’t had to I didn’t look any further into it. But the complaints of fragmentation really makes me question the skill of most developers today period. And the benefits of Android API’s over those of other platforms outweigh the need for a little extra code to cover multiple versions IMO. Everybody is just in a rush to toss out some crap app that automatically LOOKS good because of the stock widget/element set of the platform. Theres nothing stopping folk from styling their app to any degree on Android just as you’d do a website. Ok let me stop my rant now….

  5. However you DO have to balance the time spent developing versus the projected income from that project. One dollar or even five dollar apps aren’t often going to generate enough to often justify spending more than a week or two on them.

  6. @captbebops

    depends on the app honestly. both markets (android/iPhone) have shown that you can reach 0ver 100,000 in sales at 5 bucks a tic and do very well. would you work 5 months in you spare time if you had a killer concpet and could execute it for a phone platform, knowing that at the end you would have a 500k payoff?

    I would, but I know I am not a programmer ;)

  7. if you sell 100,000 copies of your $5 app, how much time is it worth to spend developing it?

    Maybe if more people spent real time working on their apps, the quality might be nicer and they would sell more…

  8. Actually, the techniques described in the blog post don’t really have anything to do with scarce resources. It is just a technique to keep the UI responsive by moving long-running tasks to a background thread. The result actually uses more resources in most cases (extra threads add more “weight”). But it results in a better user experience because the UI does not lock up while waiting for a task to complete. The blog’s sample code is android-specific, but the technique applies to desktop apps and web apps as well.

  9. “Note: a bug in the previous versions of BitmapFactory.decodeStream may prevent this code from working over a slow connection.”

    Does anyone know when this bug was fixed. I’m working around this now in an app targeted for the 1.6 API. I assume it’s been fixed, but I’d like to get confirmation.

  10. You have about as much chance of selling a 100K copies of your app as winning the lottery. The few people who have done so had the right idea at the right time. IOW, pure luck. For the record I have been developing software since before many Android developers were even born and yes worked with one company that DID have the right idea at the right time and won that lottery.

    I don’t want to discourage anybody but a dose of reality is often very good for business.

  11. And that “lottery effect” of both the Android and the iPhone app stores are a huge deterrent to application developers everywhere. Fatal flaw #1 is that everybody flocks to the cheapest app first — the moment somebody releases something a few bucks less that sort of seems to do the same thing, your $5 app is “overpriced” and downloads drop off to nothing, even if the other app is junk. Fatal flaw #2 is that there isn’t any good way to advertise your app or otherwise differentiate yourself from the massive overload of complete junk that comprises the majority of content in both stores.

    These two problems have been well understood for quite awhile now, and there aren’t any easy answers.

    Apple does have two big advantages. Google makes things a bit worse for Android by blindly refusing to provide anything but on-phone access to their stores. On top of that, Google is still pretty clearly in the “rank amateur” camp when it comes to interacting with their developer base.

    But overall, as CaptBebpos notes — developing for either platform is a total crapshoot. At best.

  12. nerd…

  13. Android has 2 big advantages:
    1) sideloading so a you can sell apps from your website and not have to share profits to anyone. That is what Gameloft is doing.
    2) there are many OEM’s and it is possible to make a deal with them to have your app advertised on TV or bundled with the phone. We’ve seen Layar in Droid ads…that’s much better exposure than what you can get from any website or market.

  14. I just saw the gameloft game Asphalt featured in the latest SGS tv ad

  15. Replied

Leave a reply

Your email address will not be published. Required fields are marked *

More in News