Projects


A new Android project can be created using the File > New > Project menu. Normal Visual C++ projects are created and set to use a custom Android platform. Projects can be set to build in the Visual Studio environment or using external build files.

Project Templates

Eight project templates are available in the Android category.

1. Android Application

This template creates a basic Android application that contains only Java sources. The project is created with one defined Activity.

2. Android Application with Native Library

This template creates a basic Android project that includes a Native library. The project includes both Java and native C sources. One Activity is defined and includes a native JNI method that is implemented in the C source.

3. Android Hello World Demo

This project builds a sample “Hello World” application. It includes both Java and native C sources. The Java sources make JNI calls to the C sources to obtain text that is displayed on the screen. This project will build in the Visual Studio environment.

4. Android Native Application Project

This template creates a native activity application. The project does not contain Java sources and uses the NativeActivity class, http://developer.android.com/reference/android/app/NativeActivity.html.

5. Dynamic Library for Android Application

This template creates a basic dynamic native library for use in the Android applications. This project may contain only C/C++ code.

6. Import Android Project

This template creates a Visual Studio project for an existing Android SDK and/or NDK project. The sources for the existing project are imported into the Visual Studio project. The template includes a wizard to specify the location of the existing project and what files should be imported into the Visual Studio project.

The configuration type for this project will be set to Make Application. It will build with ANT and the NDK tools ndk-build.cmd script.

7. Import Android Project and Create JNI Library

This template creates a Visual Studio project for an existing Android SDK project. It is used when you want to add native C sources to an existing Android Java project. It will add template JNI C source files and build a native library.

8. Static Library for Android Application

This template creates a basic static native library for use in the Android applications. This project may contain only C/C++ code.

Project Properties

Project properties can be accessed through the normal means of right-clicking on the desired project and selecting the Properties menu.

General Properties

This page contains the general properties for the project.

NDK Build Properties

This page displays properties for projects that build with NDK-BUILD. It is only available when the configuration type is set to Make Application.

Debugging Properties

This page selects the debugger and options. The Android Debugger is used to debug the projects.

C/C++ Properties

This category contains pages for C/C++ compiler options.

Linker Properties

This category contains pages for linker options.

VC++ Directories

This page contains settings for the directories to search for include files and libraries.

Ant Build Properties

This page contains options for the Android SDK ANT build.

Controlling Android Devices

NVIDIA Tegra Device Toolbar

Android devices can be controlled using the NVIDIA Tegra Device Toolbar. The toolbar is displayed automatically after the extension is installed.

All connected Android devices and emulators are displayed in the drop-down menu. The first available device will be selected by default. The toolbar will remember the device selected in a previous session.

If no devices are available, <No Device> will be displayed. Device selection is disabled when debugging.

The Device toolbar lets you select the Android device for the following:

Device Information

The device information button opens a dialog that displays information for the selected device.

The dialog displays properties found in the /system/build.prop file. The dialog also displays a name for the device along with the serial number. By default, the name is set to the serial number, but you can change this to help you better identify the device.

Reboot Device

The Reboot device button will prompt to reboot the selected device.

Deploy APK on Debug

By selecting this option, the application package file (APK) will be deployed and installed on your Android device when you begin debugging your application.

Installing Applications

There are two ways to install a project application on a device. The project can be set to automatically install and run applications after a successful build. This can be set in the project properties (see Ant Build Properties).

The project can also be launched using the Visual Studio Start Debugging button. This will install the application on the currently selected device and start a debug session.

 


of

NVIDIA GameWorks Documentation Rev. 1.0.140702 ©2014. NVIDIA Corporation. All Rights Reserved.