Sunday, December 02, 2007

Android on Ubuntu 7.04, Feisty Fawn


Today I installed Android on my vmware emulated Ubuntu 7.04 instance of Linux running on my Windows XP PC by following the below three easy steps.

1. The SDK
First, I downloaded the Android SDK for Linux (currently versioned at m3-rc22a and weighing in at 55 MB). I unpacked the archive in my home directory.

2. The IDE
Then I downloaded Eclipse for Linux (currently eclipse-java-europa-fall2-linux-gtk.tar.gz weighing in at 78.6 MB). I unpacked this in my home folder as well.

3. The Plug-in
Finally, I installed a custom plugin called the Android Development Tools (ADT), which adds integrated support for Android projects and tools. To download and install the ADT plugin, set up an Eclipse remote update site as described in the steps below.

1. Start Eclipse, then select Help > Software Updates > Find and Install....
2. In the dialog that appears, select Search for new features to install and press Next.
3. Press New Remote Site.
4. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:

https://dl-ssl.google.com/android/eclipse/

Press OK.
5. You should now see the new site added to the search list (and checked). Press Finish.
6. In the subsequent Search Results dialog box, select the checkbox for Android Plugin > Eclipse Integration > Android Development Tools and press Next. Currently, ADT 0.3.1.
7. Read the license agreement and then select Accept terms of the license agreement, if appropriate. Press Next.
8. Press Finish.
9. The ADT plugin is not signed; you can accept the installation anyway by pressing Install All.
10. Restart Eclipse.
11. After restart, update your Eclipse preferences to point to the SDK directory:
1. Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences)
2. Select Android from the left panel.
3. For the SDK Location in the main panel, press Browse... and locate the SDK directory.
4. Press Apply, then OK.

That's it!

To test it I created my first Android project by follow these steps:

  1. Select File > New > Project
  2. Select Android > Android Project, and press Next
  3. Select the contents for the project:
    • Select Create new project in workspace to start a project for new code.

      Enter the project name, the base package name, the name of a single Activity class to create as a stub .java file, and a name to use for your application.

    • Select Create project from existing source to start a project from existing code. Use this option if you want to build and run any of the sample applications included with the SDK. The sample applications are located in the samples/ directory in the SDK.

      Browse to the directory containing the existing source code and click OK. If the directory contains a valid Android manifest file, the ADT plugin fills in the package, activity, and application names for you.

  4. Press Finish.
I selected the HelloActivity sample and ran it which popped up the Android Emulator. Next, I'll start on the exercises one by one. Probably the Hello, Android! project would be the best place to start.

0 Comments:

Post a Comment

<< Home