Google’s Android – a first look


Android EmulatorI downloaded Google's Android SDK today.  The kit is about 55MB for linux and was a breeze to get running.  The kit comes with an emulator that displays a generic phone with the google UI.  The majority of the online help is geared towards creating applications that run on android.  The application development environment requires java (there is no native C/C++ interface at the moment) and there is an Eclipse plugin for people who need IDE's to build software.  Fortunately, I don't need IDEs and Google does a good job helping those who don't use eclipse get started.  There are plenty of command line tools available in the tools directory of the sdk.

How this works is that you create an Activity project using activityCreator.py (in the tools dir), write your code, and build it with ant.  The build.xml created by activityCreator.py handles the packaging for you.  Android requires applications be packed in a special format called apk, which is a wrapper for another format called dex.  At the moment I don't know anything about those formats but I don't really care either.  Since the autogenerated build.xml handles the packaging I can focus on application development.

Once the application is built you install it in the emulator's environment using the adb debugger:

adb –install file.apk

You need to be in the HOME page of the UI.  You're initial application will probably show up under the Applications folder though I'd suspect you can stuff it anywhere you want in the UI. 

I built the autogenerated code for a new project without writing any of my own code and installed it.  It worked perfectly.

Since I'm quite familiar with building applications under ant now (thanks to the grid system I'm building in my day job) I next wanted to see what ui components are available.  Android has some sophisticated features like transparency and mixed 2D/3D displays.  The documentation for their UI libraries are quite complete for a first release.  The widget set is extensive enough to build very useful applications.

My first impressions of this project is that it's complete enough to do serious development.  Considering they're offering $10million in prize money for applications, I think that's a very important point to make.  Anyone who waits is going to be left behind on this one.

update: 2007-11-16
I've played with the tutorials.  They're fairly well written and easy to follow, although if you, like me, don't use eclipse (I use vi and cscope) you have to cheat a little to see what eclipse may be hiding, uh, I mean automatically doing for you.  IDEs suck.  You'll never learn anything if you let an IDE do all your work for you.

Anyway, I discovered that adb, the tool used to upload the binaries to the device, doesn't appear to have a delete option.  So you can install apps but not remove them.  At least not as far as I can see.  I got around this by using the adb shell to manually delete the .apk files.  What happens when you do this is that the device errors trying to load the file (because it's gone) and causes the Applications folder to be reread.  Essentially, the device recovers gracefully when the .apk's are removed out from underneath it.  That's a good sign.  Nice, stable environment to develop in.

So, more investigation.  I find that the basic classes available are rather interesting (lots of harware, os and environment classes) and plan on extending the initial NotePad application to pull information from the device.  One of the first things I want to do is deteremine how to receive an event when a button is pressed.  Not a keyboard button, but one of the buttons on the side.  I'm wondering if you can hijack those for your application.  Anyway, more fiddling to come…