Learning Android Programming

(Originally posted 2011-03-17.)

A while back I set myself a technical challenge: To learn how to program an Android device.

NOTE: I don’t have a real application in mind, just idle curiosity and a degree of annoyance at the prerequisites to be able to program an iPhone (apart from as a WebApp).

Here’s what I did and how I’ve got on:

My Equipment

  • I bought the cheapest Android tablet I could find. It’s an Intempo I.D. Spirit. It runs Android 1.6 (not upgradable as far as I know) and you have to fairly thump the "touch screen" to get it to do your bidding. It’s slow  but that’s OK. At least it’s colour and very portable.

    You’ll find lots of similar or better machines at a low price.

    The point is that – up to a point – the hardware isn’t important for learning on. (But note this one won’t do "gestures" and the like.)

  • I bought a SanDisk microSDHC card reader, which plugs into a USB port on my laptop. (And a 8GB card to go in it.)

    While I could’ve used wireless to install it seemed much easier to just do the card-juggling thing. And I could’ve gotten away with a much smaller memory card.

  • I installed the Android toolkit on my laptop. I’m running Ubuntu Linux as it happens. I’m sure you can do this on other platforms.

  • I bought "Hello Android" by Ed Burnette (Third Edition, which covers Android 2 as well as the 1.6 I’m targeting). The website for the book is here.

That’s all: A machine, a way of transferring programs, the SDK and a book. What more could you need?

I experimented with the Eclipse environment for Android development but couldn’t get it to build. (But then I like to use a text editor and manually drive the build tools anyway – just to get a feel for what’s really going on. If I were a real Android application developer I’d probably make Eclipse work for me.)

My Experience

The "Hello, Android" book is well written – easy to follow but not condescending. And the website has downloads and errata. Ed’s clearly taken this seriously. I’ve not had a book from "The Pragmatic Programmers" before but I think I’d buy others if a cursory glance suggested they were similarly executed.

First the book takes you through creating a "Hello, Android" application – using the SDK. This worked well. I did have to look up how to sign the application using keytool and jarsigner (the latter being invoked automatically by the ant script the SDK creates to enable you to build). It ran just fine when installed from the card into the Android device.

Then, and here’s the real meat of it, the remaining chapters teach you how to build a Sudoku application. The book does this in an incremental fashion, which really works well.

It really helps if you’re already familiar with java and XML: You’d be editing those sorts of files quite a lot.

My Conclusion

It really is possible to go from zero to being reasonably competent in building an Android application with not much hardware, a flash memory card, the SDK, a text editor and a good book. And that’s the way it should be, I think.

The other nice thing is it seems to be something you can learn in small chunks – maybe an hour at a time.

Published by Martin Packer

.

Leave a Reply

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

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: