Connie's Blabber

Wednesday, July 2, 2008

Android SDK

Having just installed Apple's iPhone SDK, I thought I'd get Google's Android, which is "an Open Handset Alliance project" and branded to be "the first complete, open, and free mobile platform." Here is a log of what I had to do to install the Android SDK version m5-rc15 on Linux (kernel 2.6.24-19, Ubuntu Hardy 8.04).

I used the installation instructions at http://code.google.com/android/intro/installing.html as my main reference. Downloading the SDK from the Google site was a breeze. I unzipped the ZIP file into /opt, and added /opt/$AndroidDir/tools to my PATH environment variable.

First, I tried to run the Android Emulator on its own, and got a nasty error about the program not being able to read some file. It turned out that two files in /opt/$AndroidDir/tools/lib/images, system.img & userdata.img, needed to have read-access-for-others added. After that, the emulator program started successfully. (What an ugly-looking device though. Oh well, not the most important thing...)

Although an IDE is not necessary, and I personally prefer the terminal window and the command line, it's not a bad idea to have an IDE around for GUI programming. Google recommends Eclipse. Why not? I went to Ubuntu's Synaptic Package Manager, and installed Eclipse 3.2 from there. Afterwards, with some difficulty, I installed the Android Development Tools plugin in Eclipse.

Next, I created a test program by following the instructions at http://code.google.com/android/intro/hello-android.html. No problem with the files, etc., but when I tried to run the test program, I got an error in Eclipse: "Could not find /bin/HelloAndroid.apk!".

After much digging on the Net, I learnt that I must (1) install Sun's Java JDK first; and (2) install Eclipse from www.eclipse.org because the one from Ubuntu is no good. There is a nice little Howto at http://flurdy.com/docs/eclipse/install.html. Note that the part about installing Apache Tomcat can be ignored. I ended up installing Sun's Java JDK 6, and the latest version of Eclipse, Ganymede 3.4. As an aside, for some strange reason, the Eclipse installation package does not contain an icon file, so I found one on Google Images, and used it during the Ubuntu application menu setup.

After all this, I tried to run my test program HelloAndroid, again. This time, everything worked!

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home