{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
Getting Started with Android on a Mac
Summary
This article discusses installing Eclipse (Ganymede), Android SDK, and Android Plugin for Eclipse on a Mac. Screenshots included.
 
Table of Contents

Downloading and Installing Eclipse

Figure 1. The Eclipse (version Ganymede – version 3.4 of Eclipse) Download. Several different packages are available. The JEE package contains the most for Java developers.

Figure 2. Downloading eclipse-jee-ganymede-macosx-carbon.tar.gz for installing Eclipse on Mac

Figure 3. The eclipse GANYMEDE Start screen. Callisto, Europa, and Ganymede are all satellites of Jupiter.

Figure 4. Selecting a workspace to store the projects

Figure 5. The Eclipse icon (next to Xcode Tools) in the Dock on a Mac. Here Xcode is for iPhone and Eclipse is for Android.

Getting Android SDK

Figure 6. Downloading the Android SDK on Mac. Here the SDK for Mac (version 0.9) is downloaded.

Installing Eclipse Plugin

Figure 7. Obtaining the Eclipse Plugin from Google. Updates for regular eclipse components are done from eclipse.org site.

Figure 8. Installing the Android plugin for Eclipse. This will install the development tools and editors.

Figure 9. SDK location in Eclipse/Android Preferences. This is where the Android project will find the Android SDK.

Figure 10. Snake example in the Android Emulator on a Mac

 

Downloading and Installing Eclipse

The Eclipse (Ganymede) can be downloaded from the following location:

Eclipse Download Page

The Android Applications are developed using Java programming language. Eclipse, though known primarily as a Java Development Tool, can be used with other languages. For Android applications, you need to choose an Eclipse package that contains JDT (Java Development Tools). Most of the Eclipse packages come with this.

Figure 1. The Eclipse (version Ganymede – version 3.4 of Eclipse) Download. Several different packages are available. The JEE package contains the most for Java developers.

Figure 1. The Eclipse (version Ganymede – version 3.4 of Eclipse) Download. Several different packages are available. The JEE package contains the most for Java developers.

Here the Eclipse package downloaded is “Eclipse IDE for Java EE Developers”, which is the largest Eclipse package. This package contains JDT. JDT comes with an Editor for Java, a Debugger, a Package Explorer, etc. The Java Editor in JDT has all the usual features of a code editor – keyword and syntax coloring, code formatting, help within the editor, etc.

The package (eclipse-jee-ganymede-macosx-carbon.tar.gz) is 162MB, so, it might take a little while to download.

Figure 2. Downloading eclipse-jee-ganymede-macosx-carbon.tar.gz for installing Eclipse on Mac

Figure 2. Downloading eclipse-jee-ganymede-macosx-carbon.tar.gz for installing Eclipse on Mac

Windows has built-in support for extracting .zip files; however, a Mac can easilty extract from the .tar.gz files. Just double-clicking on the downloaded .tar.gz file will unzip the files; and that is the Eclipse installation.

You can move the eclipse directory to another folder of convenience. Among other things, this eclipse folder has a file called Eclipse.app. Double-clicking on this will start the Eclipse application.

Figure 3. The eclipse GANYMEDE Start screen. Callisto, Europa, and Ganymede are all satellites of Jupiter.

Figure 3. The eclipse GANYMEDE Start screen. Callisto, Europa, and Ganymede are all satellites of Jupiter.

Then choose a folder to save the projects that would be created from Eclipse. You can settle down on one default folder, where all the projects will be saved. If the “Use this as the default …” checkbox is checked, this Workspace Launcher will not come up again.

Figure 4. Selecting a workspace to store the projects

Figure 4. Selecting a workspace to store the projects

To make it easy to launch Eclipse, you can drag it on to the Dock. Here Eclipse is next to Xcode Tools in the Mac Dock. Xcode Tools are used for developing applications for Mac OS X and iPhone using (primarily) Objective-C programming language. And, here, Eclipse is used for the development with Java programming language, including applications for Google’s Android.

Figure 5. The Eclipse icon (next to Xcode Tools) in the Dock on a Mac. Here Xcode is for iPhone and Eclipse is for Android.

Figure 5. The Eclipse icon (next to Xcode Tools) in the Dock on a Mac. Here Xcode is for iPhone and Eclipse is for Android.

Getting Android SDK

Once the Eclipse is downloaded and setup, you would need to get the Android SDK for developing applications for Android. You can download the Android SDK from the following location.

Android SDK

Figure 6. Downloading the Android SDK on Mac. Here the SDK for Mac (version 0.9) is downloaded.

Figure 6.  Downloading the Android SDK on Mac. Here the SDK for Mac (version 0.9) is downloaded.

Once again, installing the SDK is a matter of unzipping the zipped file to your favorite location. Wherever you install (unzip) it, the entire directory can be moved to somewhere else. The primary content of this directory is android.jar, which is a huge collection of classes that make up the Android SDK. This .jar file will be added to all the Android projects.

Installing Eclipse Plugin

Finally, to make the Android development easier, you can download the Android plugin for Eclipse from the following location:

Eclipse Plugin

This plugin can be downloaded directly from Eclipse. In the Ganymede version of Eclipse, you can go to Help – Software Updates menu item to manage the software updates and add-ons.

Figure 7. Obtaining the Eclipse Plugin from Google. Updates for regular eclipse components are done from eclipse.org site.

Figure 7. Obtaining the Eclipse Plugin from Google. Updates for regular eclipse components are done from eclipse.org site.

After pointing Eclipse to Google site, the Android Developer Tools will be available from Eclipse.

Figure 8. Installing the Android plugin for Eclipse. This will install the development tools and editors.

Figure 8. Installing the Android plugin for Eclipse. This will install the development tools and editors.

Now Eclipse needs to know where the Android SDK is. From the Preferences window, add the SDK location. You can go to the Preferences window from Eclipse – Preferences menu item.

Figure 9. SDK location in Eclipse/Android Preferences. This is where the Android project will find the Android SDK.

Figure 9. SDK location in Eclipse/Android Preferences. This is where the Android project will find the Android SDK.

That will set up all the required tools for Android development using Eclipse. In order to test whether everything is set up fine, you can open up a sample project (the samples – ApiDemos, HelloActivity, LunarLander, NotePad, SkeletonApp, and Snake – are in the samples folder under the android sdk directory). Following is the Snake example.

Figure 10. Snake example in the Android Emulator on a Mac

Figure 10. Snake example in the Android Emulator on a Mac

Bookmark and Share This

More Articles With Similar Tags
icon-android-debug-toolbar.jpg
This article gives some quick pointers on how to start debugging an Android application, along with where to put the breakpoints and how to change the emulator sizes from within Eclipse.
icon-android-safari-browser-user-agent-string.jpg
This article talks about the basics of the browser (including the user agent string) used in the Android platform.
This article talks about various aspects of creating an SQLite database. It also uses Android SQLite shell as an example.
This article explains how to get pretty / nice output from the SQLite command line shell program.
icon-android-emulator-hvga-p-lunar-lander.jpg
See the images of various skins and screens of Android emulator with games (Lunar Lander and Snake) in them. Also shows how to change the skins of Android emulator while debugging your program.
About  Contact  Privacy Policy  Site Map