Table of Contents

Working with projects

This chapter describes how to perform typical development actions on Android projects.

Choosing target platform

First of all, you should choose the target platform (determining Android system and API versions). Right-click on the project node in Solution Explorer and select the Common tab. There is a setting named Project target. Here you can enter the platform name as defined by the SDK (e.g. "android-9"). Subsequent WinGDB versions will allow to select the platform from the list.

You can also change the platform at any moment. In current beta there is a problem so that the project will be updated during Deploy step (not Build), therefore you will have to repeat the Build/Deploy cycle two times after you change the platform.

Choosing target ABI

Typically you will debug your application on Android emulator. In such case, you have to set armeabi as one of target ABIs (you can define multiple ones). The setting is located also in the project node properties, in Configuration tab. Other ABIs are intended to be used on physical devices. They might allow faster code execution.

Building native modules

In order to build native and Java modules in the project, choose the Build option. This builds installable package in case of Java and Java+Native projects.

Building release packages is not completely functional in current beta. These packages require signing and this step is not implemented.

In case of compilation errors, you can double click in the build console to jump to the error, just as with standard Visual Studio projects.

Adding external libraries

As WinGDB supports the Prebuild modules feature of NDK-build, you can add external libraries to package. A prebuilt module is really some kind of link to a library file residing somewhere on disk. You can specify path to that file (relatively to your Android.mk file) setting the Prebuilt module path option in module common properties. The file will be properly added to your package by NDK-build system.

You add a prebuilt module using Add/New item option in context menu of the project. Select either Prebuilt static module or Prebuilt shared module module type from the list.

One of possible applications of that feature is importing libraries built by external build system, like vs-android. You can mix WinGDB and vs-android projects in single solution. There can be single WinGDB project serving as a root of the package (and hosting Java files) and multiple native libraries built by vs-android and imported into the root via prebuilt modules.

Prebuilt modules are not automatically linked to normal modules. If they are supposed to be not loaded dynamically but linked, you can specify them setting Linked shared libraries and Linked static libraries properties.

Building and deploying the package

The Deploy option deploys the package to the device selected on Debug property page on the project node.

Debugging

After the package had been deployed, you can debug it. Your AndroidManifest.xml file must contain the android:debuggable attribute, as described in the SDK documentation. Currently you have to set it manually. Subsequent WinGDB versions will allow to edit also that file.

Before starting debugging, you might want to set some options. They have default values which are appropriate in most cases. These options are located on the Debug property page for the project node.

The most important one is Debug target device. Ensure that emulator is entered here to debug on the emulator, or device for a single connected device. There might be also a device (or emulator process) name entered, as listed by adb devices command.

The emulator should be running before starting debugging. WinGDB does not start it, as the SDK already has appropriate user interface for it.

In order to be able to debug on a device, usually a debug mode must be enabled on it. Please consult Android SDK documentation on that topic.

You can debug in two modes:

Table of Contents


Copyright (C) 2008-2011 WinGDB.com. All rights reserved.