Building and Running Android Application from Eclipse with ADT
by, 02-11-2012 at 11:09 AM (4563 Views)
Details of the build process are hidden when using Eclipse and ADT. Build process in running continuously in background and automatically build application when you make changes to code. Following topics will explain how to run application.
Running on the emulator
Create an AVD when you are running your application on the Android Emulator. Follow these steps to run your application
• From Eclipse menu bar select Run > Run (or Run > Debug) from the Eclipse menu bar.
• Default run configuration is created for by The ADT plug-in automatically
• Then Eclipse will do the following:
1. Compile the project
2. Create default run configuration
3. Install and start the application on an emulator
Running on a device
Perform following setup on your device before running Android application.
• Application must be debuggable by setting the android:debuggable attribute.
• In ADT 8.0, it is set by default.
• On you device, enable USB Debugging.
• Go to Settings > Applications > Development > USB debugging to configure this setting.
• USB device must be detected by your development computer whenever you connect a USB device.
Creating a Run Configuration
Following are specified in the run configuration.
• Activity to start
• emulator or connected device to use
ADT creates a run configuration when you run project as an Android Application. Default project Activity is launched by the default run configuration. You can customize these settings as well.
Following points will discuss about how to create Run configuration for an Android project:
1. Select Run Menu and open run configuration manager.
2. Expand and create new configuration for the Android Application.
3. With the Run Configuration selected, adjust your desired run configuration settings.