2.12 Loading the hello-neon application on to an Android target

Describes how to load the hello-neon application on to an Android target.

Procedure

  1. Launch Eclipse.
  2. Start the target.
  3. Create a new Android project:
    1. Select File > New > Project...
    2. Expand the Android group and select Android Project.
    3. Click Next.
    4. Enter a suitable project name. For example, HelloNeon.
    5. Select Create project from your existing source.
    6. Click Browse... to locate the hello-neon folder.
    7. Click Next.
    8. Select the required Build Target. For example, Android 2.2.
    9. Click Finish.
  4. Ensure that the application builds with debug information. You can do this by:
    1. Open the AndroidManifest.xml file.
    2. Click on the Application tab.
    3. Select true in the Debuggable field.
    4. Save the changes and close the file.
  5. Build the hello-neon source files with debug information using the scripts provided by the Android NDK. This tutorial uses the NDK revision 6b. For example:
    ./ndk-build -C samples/hello-neon NDK_TOOLCHAIN=arm-linux-androideabi-4.4.3 NDK_DEBUG=1
  6. Select the Android project and build the HelloNeon.apk.
  7. Create a new Android Virtual Device (AVD) and start the emulator.
  8. Select Debug Configurations... from the Run menu.
  9. Select DS-5 Debugger from the configuration tree and then click on New to create a new configuration. Alternatively you can select an existing DS-5 Debugger configuration and then click on Duplicate from the toolbar.
  10. In the Name field, enter a suitable name for the new configuration. For example, HelloNeon.
  11. Click on the Connection tab to see the target and connection options.
  12. In the Select target panel:
    1. Select Android - Generic platform.
    2. Select Download and debug an Android application for the debug operation.
    3. Select the emulator in the Connections field.
    Figure 2-15 Typical Connection tab settings for an Android application
    Typical Connection tab settings for an Android application

  13. In the Files tab, click on Workspace... for the Project directory field and select the hello-neon directory. This automatically populates the other fields.
    Figure 2-16 Typical Files tab settings for an Android application
    Typical Files tab settings for an Android application

  14. Click on the Debugger tab and select Connect only in the Run control panel.
  15. In the Paths panel, click on Workspace... and select the hello-neon directory.
    Figure 2-17 Typical Debugger tab settings for an Android application
    Typical Debugger tab settings for an Android application

  16. Click on Debug to connect to the target.
  17. Debugging requires the DS-5 Debug perspective. If the Confirm Perspective Switch dialog box opens, click on Yes to switch perspective.
  18. To debug the application, set breakpoints, run, and step as required.

Note

If the application exits before NDK can attach gdbserver to the native library then you might need to add a delay before launching the Java native libraries.
Related tasks
2.11 Setting up the Android tools for use with DS-5
2.13 Connecting to an application that is already running on an Android target
Related information
DS-5 Knowledge Articles
Eclipse
Cygwin
Android Developers
Non-Confidential - BetaPDF file icon PDF versionARM DUI0478U
Copyright © 2010-2015 ARM. All rights reserved.