Eclipse & Android Installation
At this point, Eclipse and the Android SDK should be all ready to write your first Android application. 1.5 Hello Android! …
More PDF Content
Lab 1, Eclipse & Android Installation, 1.2 The Android SDK, 1.1 The Supported Tools, 1.3 Eclipse, 1.5 Hello Android!, 1.6 Extras, 1.4 Making Eclipse Aware of the Android SDK
he Android SDK
In the directory /Applications/android-sdk-mac_x86-1.5_r3 you’ll find the Android SDK. In particular, you’ll find a subdirectory called “tools,” which is where the command-line programs live, and it is handy to have them added to your PATH environment variable. Open your ~/.bashrc file with a text editor (if you don’t have a .bashrc file, now is a good time to create one). We want to do two things: add the tools directory to your path, and export your path so that it is available to processes started by your shell. Add the line to your .bashrc file:
Then, at the end of the file, add the line (if it isn’t already there):
This will cause all non-interactive shells to have the tools directory in their path. To get login shells to have it too, you should add the following lines to your .bash_profile file. (Again, if you don’t have a .bash_profile yet, you should create one now.)
if [ -f $HOME/.bashrc ]; then source $HOME/.bashrc fi
1.1 The Supported Tools
To begin writing an Android application, you write a Java class that extends the Activity object. You can do this using a text editor, but there is a lot of configuration to get right, so we are going to use Google’s “officially” supported IDE, which is Eclipse. You also need to install the Android SDK, which is a set of command-line tools. To do this, you need enough Unix knowledge to add a set of executable files to your PATH environment variable. Today’s task is to get the Android emulator running on a lab Macintosh, and to get it to run a “Hello World” application. We’re going to do this in a few stages:
Then open a new terminal window. You can tell if the procedure worked by typing
You should see the directories that you typically have on your path (e.g. /bin and /usr/bin) and you should also see the Android SDK tools directory tacked on the end. You can double-check this by typing:
TB 9-2320-280-35-9, Army, INSTALLATION... - US Army and...
TB 9-2320-280-35-2, Army, INSTALLATION... - US Army and...
TB 9-2320-280-35-13, Army, INSTALLATION... - US Army and...
TB 9-2320-280-35-6, Army, INSTALLATION... - US Army and...