After putting off Android for quite some time, I finally decided to dig in. I must admit, however, that it was Verizon's clever marketing campaign in coordination of the upcoming launch of the Verizon Droid that motivated me enough to do it. For the last year or so I've had friends and family memers mention on occasion that I 'should' be developing applications for the iPhone (perhaps they're all thinking that I'll strike gold and share some moola), but I never could motivate myself. First of all, I'm not an Apple fanboy. Secondly, I don't own a Mac so that kind of kills it. Apple has seen to it to exclude Windows developers from getting in on the action. Android and Google is a completely different story.
The Android SDK plugs into the Eclipse IDE quite seamlessly. I was able to get Eclipse and the Android SDK installed, updated, configured, and ran my initial "Hello World" application within about an hour. Since Eclipse runs on Windows (as well as Linux and Mac), I was able to dig right in. Kudos to Google.
Let's see what it's all about.
The best place to start is right here: http://developer.android.com/sdk/index.htm
I'm not going to reproduce their work, so let's get right to how things look (this is running on a fresh install of Windows 7) ...
Running the AVD
... still booting ...
... and still booting ...
The whole bootup process takes far too long. I have yet to be able to find a way to shorten it.
Unfortunately, every time you make a code change and want to run your application, you must wait for about 1 min or so for the AVD to fire up. Unless I've just not found it, this is a step back from developing against the .Net CF as the emulators there enter a standby mode when you stop debugging. ***EDIT*** You do not need to shut down the emulator in order to deploy new code. Simply minimize the AVD, make your code changes, then run the application via Eclipse. The updated application will run correctly.
According to Google's "Hello World" tutorial, you can simply change this:
to this ...
... and Voila! But this DOES NOT work. At first glance it (seemingly) works, but change the argument of setText to "Howdy, Android" and you will still get "Hello, Android" when you run the AVD. I tried several times recompiling my code. Nothing worked.
To resolve this, you need to understand that Android applications support two ways of building the user interface: through code and XML files1. If you browse to 'res/layout/main.xml' and "Open with XML Editor", you'll see the following:
The key here (literally) is in the @string/hello. Now open 'strings.xml' and find the Resource Element called 'hello' which is being referenced here. If you change the value here to something else, it will work.
Run your application again (and wait, and wait, and wait) ...
Nothing dramatic yet. Just getting up and going. Perhaps someone else had or will have the same issue and this will help.
Tell me if you know how to speed up running the apps on the AVD.
More to come on this.
Sources: 1. "Getting Started with Android Development Using Eclipse", September 15, 2008, Wei-Meng Lee, http://www.devx.com/wireless/Article/39101