You're almost at the point where you can run the application. A launch configuration specifies the project to run, the activity to start, and the emulator or device to connect to. Whoa! That's a lot of stuff happening real quickly. Not to worry; the ADT can help you by automating a lot of the key steps so that you can get up and running quickly.
The Android ADT gives you two options for creating launch configurations:
When you first run a project as an Android application by choosing RunRun, the ADT automatically creates a run configuration for you. The Android Application option is visible when you choose RunRun. After the run configuration is created, it's the default run configuration, used each time you choose RunRun from then on.
Now it's your turn to create a run configuration for your application.
If you're feeling ambitious and decide that you'd like to create a run configuration manually, follow along here. Don't worry — it's very simple. Follow these steps:
The Run Configurations dialog box opens, as shown in Figure 5-11. In this dialog box, you can create many types of run configurations. The left side of the dialog box lists many types of configurations, but the ones that apply to Android apps are as follows:
The New Launch Configuration window opens.
The Project Selection dialog box opens.
In this case, the default activity is MainActivity, which you set up in the section “Starting a New Project in Eclipse,” earlier in this chapter.
This device is the AVD that you created previously. By selecting it, you're instructing this launch configuration to launch this AVD when a user runs the app by choosing RunRun. This view has both manual and automatic options. The manual option allows you to choose which device to connect to when using this launch configuration. Automatic sets a predefined AVD to use when launching in this current launch configuration.
Congratulations! You've created your first launch configuration by hand.
At some point, during your very successful and lucrative Android development career, one of your applications may have a problem on one particular device. Launch configurations are designed to help you launch into a particular environment quickly. Setting up launch configurations can be a time-consuming task, however — which can be frustrating, especially if the new launch configuration is only slightly different from an existing launch configuration. Fortunately, the ADT has included functionality that duplicates existing launch configurations. This functionality enables you to quickly create various launch configurations that are set up independently with their own configuration in mind.
To duplicate an existing launch configuration, follow these steps:
Doing this creates a new launch configuration that's an exact copy of ExampleConfiguration. Its name will be ExampleConfiguration (1).
At this point you can change various settings to give the launch configuration a unique configuration.
18.218.228.99