Android Tutorial

(avery) #1
Android Tutorial 57

Follow these steps to create a basic Run Configuration for the
Snake application:



  1. Choose Run, Run Configurations (or right-click the Project and choose
    Run As).

  2. Double-click Android Application.

  3. Name your Run Configuration SnakeRunConfiguration

  4. Choose the project by clicking the Browse button and choosing the Snake
    project.

  5. Switch to the Target tab and, from the preferred AVD list, choose the
    Android_Vanilla2.2 AVD created earlier, as shown in Figure.


You can set other options on the Target and Common tabs, but for
now we are leaving the defaults as they are.


Running the Snake Application in the Android Emulator


Now you can run the Snake application using the following steps:



  1. Choose the Run As icon drop-down menu on the toolbar (the green circle
    with the triangle).

  2. Pull the drop-down menu and choose the SnakeRunConfiguration you
    created.

  3. The Android emulator starts up; this might take a moment.

  4. If necessary, swipe the screen from left to right to unlock the emulator, as
    shown in Figure.

  5. The Snake application now starts, as shown in Figure.


You can interact with the Snake application through the emulator
and play the game. You can also launch the Snake application from
the Application drawer at any time by clicking on its application
icon.

Free download pdf