Wednesday, January 13, 2010

First impressions Android SDK

So I finally got round to configuring the Android SDK on my laptop at home. One of the reasons I wanted Android over an iPhone was for the development environment. However, I've been too busy simply enjoying using the phone to install the SDK. Plus, if I am completely honest, I was a little reluctant, expecting it to be a bit of a pain to get setup and working. Nothing could have been further from the truth. The overall impression of the SDK is very good.

The documentation is very good. Having read some Google Documentation - this is a bit of a step up. For a start the documentation is very well structured. Lots of good navigation and good cross-linking which is a refreshing change from some of Google API's which have a kind of flat (get quickly lost) structure (I'm looking at you Google Visualisations Docs). The narrative in the documentation is also well thought out.

Downloading the Android SDK, is an Eclipse RCP app which allows you to download different versions of the API (simultaneously) - right up to 2.1. This allows you to develop your app against different API versions. Then you just need to install the Eclipse Plugins into Ganymede (or better) from Android's update site and restart. The whole process takes about 5 minutes. Once you have this you can create a Virtual Device profile and start it up This takes about a minute and a virutal phone arrives on your desktop, it goes through Android's boot sequence and then you've got your virtual phone. I did one that matched my phone.

Then I installed the Hello World Sample (each API release ships with a number of samples) - to have a look at the code. It's a pretty simple example, but the main parts are:  
  • application manifest (what it's called, how to launch it etc).
  • HelloActivity.java - this subclasses the activity and creates an editable view.
  • layout - hello_activity.xml - nicely the Eclipse builder for the project is set to automatically generate a layout class from this which means you can refer to the generated class in the HelloActivity.java - nice - static checking support!
  • strings.xml - resource file for putting the Hello World string in.
Right-click and select "Run As... Android Application" and it auto deploys to the Virutal Phone and starts the application up. Fantastic. Then you can interact with (since it's an editable view, you can bring up the keyboard). Or Press the Home key and then multi-task back into it. I was impressed with how it all just worked out of the box.

Finally, I decided I wanted to see it on my own Acer Phone. So I connected it up via USB. Put the phone into USB debugging mode. Windows detected it, so did the ADB (Android Debugging Agent) which was installed in windows and it magically pops into my device list in Eclipse. Select "Run As... Android Application" again and bingo - it's on my phone.

So far very slick. Plus it's Eclipse and Java development - which is huge.


0 Comments:

Post a Comment

<< Home