With the guided project setup it provides, as well as tools integration, custom XML editors, and debug output pane, ADT gives you an incredible boost in developing Android applications. This document provides step-by-step instructions on how to download the ADT plugin and install it into your Eclipse development environment.
Android offers a custom plugin for the Eclipse IDE, called AndroidDevelopment Tools (ADT). This plugin provides a powerful, integratedenvironment in which to develop Android apps. It extends the capabilitiesof Eclipse to let you quickly set up new Android projects, build an appUI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.
If you need to install Eclipse, you can download it from eclipse.org/mobile.
Note: If you prefer to work in a different IDE, you do not need toinstall Eclipse or ADT. Instead, you can directly use the SDK tools to build anddebug your application.
Download the ADT Plugin
- Start Eclipse, then select Help > Install NewSoftware.
- Click Add, in the top-right corner.
- In the Add Repository dialog that appears, enter 'ADT Plugin' for the Name and thefollowing URL for the Location:
- Click OK. If you have trouble acquiring the plugin, try using 'http' in the Location URL,instead of 'https' (https is preferred for security reasons).
- In the Available Software dialog, select the checkbox next to Developer Tools and clickNext.
- In the next window, you'll see a list of the tools to be downloaded. ClickNext.
- Read and accept the license agreements, then click Finish. If you get a security warning saying that the authenticity or validity ofthe software can't be established, click OK.
- When the installation completes, restart Eclipse.
Eclipse is a software designed to manage IDE for Java language. It is ideal for programming applications for Windows platforms, and it lets you add text to the source code of a Windows application. Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful, integrated environment in which to build Android applications. ADT extends the capabilities of Eclipse to let you quickly set up new Android projects, create an application UI, add packages based on the Android Framework API, debug your applications using the Android SDK. Eclipse android free download - Fortnite, Twilight Eclipse Trivia (Android), Eclipse, and many more programs. I am starting to develop Android applications. Which version of Eclipse should I use? I see there are 11 versions. I am confused with these: Eclipse IDE for Java Developers Eclipse Classic 3.6.1.
Configure the ADT Plugin
Once Eclipse restarts, you must specify the location of your Android SDK directory:
- In the 'Welcome to Android Development' window that appears, select Useexisting SDKs.
- Browse and select the location of the Android SDK directory you recentlydownloaded and unpacked.
- Click Next.
Your Eclipse IDE is now set up to develop Android apps, but you need to addthe latest SDK platform tools and an Android platform to your environment.To get these packages for your SDK, continue toAdding Platforms and Packages.
Troubleshooting Installation
If you are having trouble downloading the ADT plugin after following thesteps above, here are some suggestions:
- If Eclipse can not find the remote update site containing the ADT plugin,try changing the remote site URL to use http, rather than https. That is, setthe Location for the remote site to:
- If you are behind a firewall (such as a corporate firewall), make sure thatyou have properly configured your proxy settings in Eclipse. In Eclipse,you can configure proxy information from the main Eclipse menu inWindow (on Mac OS X, Eclipse) >Preferences > General > NetworkConnections.
If you are still unable to use Eclipse to download the ADT plugin as aremote update site, you can download the ADT zip file to your local machine andmanually install it:
- Download the ADT Plugin zip file (do not unpack it):
Package Size MD5 Checksum ADT-21.1.0.zip 13564671 bytes f1ae183891229784bb9c33bcc9c5ef1e - Start Eclipse, then select Help > Install NewSoftware.
- Click Add, in the top-right corner.
- In the Add Repository dialog, click Archive.
- Select the downloaded ADT-21.1.0.zip file and click OK.
- Enter 'ADT Plugin' for the name and click OK.
- In the Available Software dialog, select the checkbox next to Developer Tools and clickNext.
- In the next window, you'll see a list of the tools to be downloaded. ClickNext.
- Read and accept the license agreements, then click Finish. If you get a security warning saying that the authenticity or validity ofthe software can't be established, click OK.
- When the installation completes, restart Eclipse.
To update your plugin once you've installed using the zip file, you will haveto follow these steps again instead of the default update instructions.
Other install errors
Note that there are features of ADT that require some optionalEclipse packages (for example, WST). If you encounter an error wheninstalling ADT, your Eclipse installion might not include these packages.For information about how to quickly add the necessary packages to yourEclipse installation, see the troubleshooting topicADTInstallation Error: 'requires plug-in org.eclipse.wst.sse.ui'.
For Linux users
![Eclipse ide for android application development free download Eclipse ide for android application development free download](/uploads/1/2/5/0/125082582/128984687.jpg)
If you encounter this error when installing the ADT Plugin for Eclipse:
...then your development machine lacks a suitable Java VM. Installing SunJava 6 will resolve this issue and you can then reinstall the ADTPlugin.
Lesson 7: Develop Apps with Eclipse
Although it’s not too demanding to develop simple Android apps (e.g., Lesson 3’s W2A app) at the command line, you will probably find it tedious to develop more complex apps in this environment. For this reason, you might prefer to use the Eclipse Integrated Development Environment (IDE).
Lesson 7 completes this course by teaching you how to use Eclipse to develop W2A. First, you learn how to install this IDE, and then learn how to install the ADT Plugin, which simplifies Android app development and testing. You can then learn how to create and run W2A in this environment.
Installing Eclipse
According to Google’s system requirements, you must install an Eclipse 3.6 (Helios) or greater package that includes the Java Development Tools (JDT) plugin. Google recommends that you install one of the following packages:
- Eclipse IDE for Java Developers
- Eclipse Classic
- Eclipse IDE for Java EE Developers
The eclipse.org website makes several IDE packages that meet different requirements available for download. I chose to download Eclipse Classic 3.7.1 for the Windows XP platform.
Assuming that you are also running Windows, point your browser to the Eclipse Classic 3.7.1 web page (http://www.eclipse.org/downloads/packages/eclipse-classic-371/indigosr1), and then perform the following steps to download and install this package:
- Select the appropriate distribution file for your platform by clicking one of the links in the Download Links box on the right side of this page. For example, I clicked Windows 32-bit.
- Click a download link, select a download mirror, and save the distribution file to your harddrive. For example, I saved eclipse-SDK-3.7.1-win32.zip to my hard drive.
- Unarchive the distribution file and move the eclipse home directory to a convenient location. For example, I moved eclipse to my C:Program Files directory.
- Create a desktop shortcut to the eclipse application located in the eclipse home directory. This shortcut makes it convenient to launch the Eclipse IDE.
Start Eclipse. Figure 20 reveals a splash screen identifying this IDE. Furthermore it reveals the Workspace Launcher dialog box, which lets you choose a workspace folder for storing the current session’s Eclipse projects.
Note: An Eclipse workspace is a disk location that’s associated with a workbench instance, where a workbench is a runtime instance of the Eclipse IDE. The workspace contains files, folders, and other resources that comprise your projects.
Figure 20: Check the checkbox to avoid being prompted each time you start Eclipse.
Click OK to close Workspace Launcher. Eclipse responds by performing some initialization, and then it presents its main window, as shown in Figure 21.
Figure 21: The Eclipse 3.7.1 IDE main window initially presents a Welcome tab.
The main window is divided into a menubar, a toolbar, a workbench area (initially presenting a Welcome tab), and a statusbar.
Install the ADT Plugin
The Android Development Tools (ADT) Plugin is a special Eclipse plugin that facilitates app development. Although you can develop Android apps without the ADT Plugin, you’d have to work directly with Android’s command-line tools. You’ll find that this plugin makes it much faster and easier to create, debug, and otherwise develop these apps.
The ADT Plugin offers the following benefits:
- It gives you access to other Android development tools from inside the Eclipse IDE. For example, ADT lets you access the many capabilities of the Dalvik Debug Monitor Server (DDMS) tool, which lets you take screenshots, set breakpoints, manage port-forwarding, and view process and thread information directly from Eclipse.
- Its New Project Wizard helps you quickly create and setup all of the fundamental files that you’ll need for a new Android app.
- It automates and simplifies the app-building task.
- Its Android code editor helps you write valid XML for your Android manifest and resource files.
- It facilitates exporting your project as a signed APK, which can then be distributed to users.
Assuming that the Eclipse IDE is running, complete the following steps to install the latest ADT Plugin revision:
- Select Install New Software from the Help menu.
- Click the Add button on the resulting Install dialog box’s Available Software pane.
- On the resulting Add Repository dialog box, enter Android Plugin into the Name textfield and https://dl-ssl.google.com/android/eclipse/into the Location textfield. Click the OK button.
- After a few moments, you should see Developer Tools in the tree-based list near the middle of the Install dialog box. Expand this node and check the checkbox to its left. You’ll discover that the Android DDMS, Android Development Tools, Android Hierarchy Viewer, and Android Traceview subnodes are also checked. Click the Next button.
- After a few moments, an Install Details pane appears and signifies that these four items will be installed. Click Next, and the Review Licenses pane appears. Read and accept the terms of these license agreements and click the Finish button.
- An Installing Software dialog box appears, giving you the option of installing these items in the background. If you encounter a Security Warning dialog box, click the OK button to close this dialog box and continue.
- Eclipse presents a Software Updates dialog box that prompts you to restart this IDE. Click the Restart Now button. After Eclipse restarts, you will probably see an Android SDK Verification dialog box stating that Eclipse cannot find the C:android-sdk-windows folder. This is not surprising, because the folder is named C:android-sdk (as specified earlier in this course when installing the SDK). Ignore this error; you will fix it shortly. Click the OK button to dismiss this dialog box.
- Select Preferences from the Window menu to open the Preferences dialog box. For Mac OS X, select Preferences from the Eclipse menu.
- Select the Android node in the left panel of this dialog box.
- Click the Browse button beside the SDK Location textfield, and then locate your downloaded SDK’s home directory (e.g., C:android-sdk) via the resulting Browse For Folder dialog box.
- After closing Browse For Folder, click Apply followed by OK on the Preferences dialog box to complete installation.
Develop and Run W2A with Eclipse/ADT
Now that you’ve installed Eclipse and the ADT Plugin, let’s revisit W2A by developing this app in this new environment. We’ll begin by creating a W2A project, which is accomplished by performing the following steps:
- Start Eclipse if not running.
- Select New from the File menu and Project from the resulting popup menu.
- On the resulting New Project dialog box, expand the Android node in the wizard tree (if not expanded), choose the Android Project branch below this node, and click the Next button.
- On the resulting New Android Project dialog box, enter W2A into the Project Name textfield – the entered name identifies the current workspace directory in which this project is stored. Continuing, select the Create new project in workspace radio button if not selected, and click the Next button.
- On the resulting Select Build Target pane, ensure that Android 2.3.3 is checked under Build Target and click Next.
- On the resulting Application Info pane, enter Welcome to Android into the Application name textfield, replacing the default W2A value. This human-readable title appears as the app’s icon’s caption on the Android device’s app launcher screen. (You could leave W2A alone if desired.) Next, enter ca.tutortutor.w2a into the Package Name textfield, check the Create Activity checkbox if not checked, enter W2A as the name of the app’s starting activity in the textfield that appears beside this checkbox, and make sure that 10 (Android 2.3.3) is current in the Minimum SDK drop-down listbox – it probably will be current. Click the Finish button.
Eclipse creates a W2A directory within its workspace directory. W2A contains the following subdirectories and files:
- .settings: This directory contains org.eclipse.jdt.core.prefs. This file records project-specific settings.
- assets: This directory stores an unstructured hierarchy of files. Anything placed in this directory can be retrieved by an app via a raw byte stream.
- bin: This directory stores the created APK file.
- gen: This directory stores the generated R.java file within a subdirectory structure that reflects the package hierarchy (catutortutorw2a).
- res: This directory stores app resources in various subdirectories.
- src: This directory stores app source code according to a package hierarchy.
- .classpath: This file stores the project’s classpath information so that external libraries on which the project depends can be found.
- .project: This file contains project-oriented information such as the name of project and what builders it contains.
- AndroidManifest.xml: This file contains W2A’s manifest information.
- proguard.cfg: This file contains configuration data for the ProGuard obfuscation tool.
- project.properties: This file contains project settings.
Close the Welcome tab. Eclipse responds by presenting Figure 22’s workbench.
Figure 22: The workbench features the solitary W2A project.
How To Setup Eclipse For Android Development
The workbench is organized around a menubar, a toolbar, several windows such as Package Explorer and Outline, a blank area that’s reserved for editor windows, and a statusbar.
Package Explorer appears on the left and presents an expandable list of nodes that identify the current workspace’s projects. To learn how Eclipse organizes the W2A project, click the “+” icon on the W2A node’s left. Figure 23 reveals an expanded project hierarchy.
Figure 23: W2A’s hierarchy is organized into src, gen, Android 2.3.3, assets, bin, and res directories; as well as AndroidManifest.xml and two configuration files.
Expand the src node followed by the resulting ca.tutortutor.w2a node. Double-click the resulting W2A.java node and you’ll see Figure 24’s editor window.
Figure 24: The editor for the W2A.java source file displays skeletal source code.
Replace Figure 24’s skeletal source code with the contents of Listing 1 (see Lesson 3). Then select Run or Run Last Launched from the menubar’s Run menu (Run appears instead of Run Last Launched if the project has not previously run). On the resulting Run As dialog box (which appears the first time you run the project), select Android Application and click OK. The W2A project is built before it runs.
Figure 25 shows you what you probably will see, especially if you’re running on Windows XP.
Figure 25: Attempting to run W2A may produce an unexpected crash.
Unfortunately, software is often poorly written and leads to program crashes. In this case, the culprit is probably a buggy ADT Plugin.
After some research and experimentation, I was able to solve this problem. I had to change the name of Android’s home directory from android-sdk to android, update my PATH environment variable to reflect this change, and disable the snapshot setting in MyAVD. I accomplished this last task by using AVD Manager to delete MyAVD, recreate MyAVD without enabling the snapshot, and start MyAVD (making sure to check the Wipe user data checkbox on the Launch Options dialog box). I then closed the emulator, started Eclipse, and attempted to run W2A. This time, I was greeted by what you see in Figure 26.
Figure 26: W2A is successfully installed and run on the emulator in the context of Eclipse.
Review
The following review questions help you test your mastery of Lesson 7’s material:
- What Eclipse packages does Google recommend for developing Android apps?
- What benefits does the ADT Plugin provide?