Archive for the ‘Android’ Category

Androidinous Efficiency: To bool or not to bool?

Wednesday, March 4th, 2009

A common belief among programmers is that you should write code that says what you mean, because the compiler will probably do a better job at optimising than you can do off the top of your head.

On the other hand, Writing Efficient Android Code says “It is unwise to rely on a compiler to “save” you and make your code fast enough” and recommends that programmers do things like caching member variables (like array lengths) in local variables. This isn’t just premature optimisation; it’s trivial stuff we expect the most basic compilers to handle!

To understand why, it helps to know how your code ends up running on device:

(more…)

Androidinous Intentions

Tuesday, February 3rd, 2009

So you’ve acquired an Android Dev Phone 1 (the page goes to great lengths to avoid telling you that it’s just an unlocked G1). You’ve downloaded Eclipse, installed the Android plugin, and created a “MyProject” app that says “Hello World, MyProject”.

Now what?

Well, if you’ve been paying attention, you’ll have heard of two (or three) new paradigms:

  • Tasks correspond vaguely to the user’s idea of accomplishing something, like “sending an e-mail”, and an associated “activity stack” which is hidden from the programmer.
  • Activities correspond loosely to subtasks, like “picking a contact”.
  • Intents are issued by activities (like SendEmailActivity) to launch other activities (like ContactPickerActivity).

But that’s about it. UI programming is traditionally a pain, which is why I like the iPhone SDK’s InterfaceBuilder — (more…)

Android Code Day

Thursday, February 7th, 2008

After a much-awaited Release Day and the obligatory pub afterwards, last Thursday marked the end of January and Android Code Day in London and Tel Aviv. It was my first time in Israel, which made it more exciting As much as I’d like to visit Israel, I wouldn’t be able to justify the expense (it might happen in the future with the current trend in ticket prices). The good news is that the train journey into London is relatively short and painless. (more…)