Open topic with navigation
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.
Nine project templates are available in the Android category.
This template creates a basic Android application that contains only Java sources. The project is created with one defined Activity.
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.
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.
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.
This template creates a VC++ Makefile-like project to call external tools to build the Android project. This project allows debugging the built application as well as external APKs without the need to build them at all. It replaces the old "Debug Only" project type.
When you select this project type, you will be presented with the External Build System Project Wizard.
This allows you to set many of the options that you will later find on the Debugging Properties page.
.sofiles reside with symbol information. Note that there are typically two copies of each
.sofile, so be sure to use the directory with the file that has not been stripped (typically the larger one). You can use Cygwin
nm.exeto inspect the
Note that this template is not called Makefile like Microsoft’s project type, to avoid confusion with makefiles used in other Android project types which utilize the NDK. Please see standard Microsoft VC++ Makefile help for more details.
This template creates a basic dynamic native library for use in the Android applications. This project may contain only C/C++ code.
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
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.
This template creates a basic static native library for use in the Android applications. This project may contain only C/C++ code.
Project properties can be accessed through the normal means of right-clicking on the desired project and selecting the Properties menu.
This page contains the general properties for the project.
|Note: If you are making an |
The Configuration Type can be one of the following:
.apk) file. For debug builds, a copy of
gdbserveris included in the application and a GDB initialization file,
gdb.setup, is created.
ndk-buildscript. Java sources are built using the Android SDK ANT to produce the final application package file.
.apkthat is not built by this project. The
.apkcould be built by a different Nsight Tegra project or come from the other sources. This project type replaces "Debug Only" projects.
maxSdkVersionattribute is lower than the API level used by the system itself, the system will not allow the application to be installed. Generally you should only set this attribute if you plan to make different versions of your app for different API ranges; otherwise, it's recommended to leave this setting blank, which provides no maximum limit.
This page selects the debugger and options. The Nsight Tegra Debugger is used to debug the projects.
.apkthat will be debugged if you are using one that is not in
am startshell command.
gdb.setupfile folder. If one is not specified, the default path will be used.
srcrelative to the working directory will be used.)
bin\classesrelative to the working directory will be used.
This page allows you to edit the deploy options of the project.
This page allows you to edit the locations of the Android SDK, Android ANT, JDK, and Android NDK.
This category contains pages for configuring C/C++ compiler options, such as additional include directories, or whether or not to generate debug info.
Nsight Tegra supports the use of precompiled headers.
On the Precompiled Header tab, you can select whether to create or use a precompiled header during the build.
To use the precompiled header, first set Precompiled Header to Use on the project level, and create two files for the precompiled header:
stdafx.cpp. Names of the files without the extension must match the Precompiled Header File property. In
stdafx.cpp add the only line:
Include any headers you want to precompile in the
Nsight Tegra forces inclusion of the precompiled header into every file that has the Precompiled Header property set to Use. However, it is better to include it manually; otherwise, the Visual Studio Intellisense might not work as expected. Note that precompiled header files are not passed to the linker/librarian.
It is also possible to print the included headers in the Output window. To configure this, set C/C++ > General > Echo Included Headers to Yes. This will make the compiler print the name of each header file used, indented with dots based on
#include depth. If you are using GCC, precompiled headers will also be printed; invalid ones are printed with
x and valid ones are printed with
!. Clang does not print included precompiled headers at all.
On the Language tab, you can select the language standard that you want the compiler to use.
This property dictates which rules the GCC or Clang compiler will use when processing the files. This affects what grammar is correct, and what language features are supported and recognized.
This category contains pages for linker options.
This page contains options for the Android SDK ANT build.
android:debuggableattribute in the manifest file. This does not affect ndk-build projects, as they're controlled by the
NDK_APP_DEBUGGABLEvariable in the
This page displays properties for projects that build with
NDK-BUILD. It is only available when the configuration type is set to Make Application.
NDK-BUILDwhen the project is cleaned.
NDK-BUILDwhen the project is incrementally built.
NDK-BUILDwhen the project is rebuilt.
Maximum Number of Parallel Build Processes — Sets the maximum number of simultaneous processes that compile native source files.
Build Verbosity — Specifies whether the Build, Rebuild and Clean operations should be performed verbosely.
NDK Project Path — Specifies a folder in which ndk-build will be run.
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.
NVIDIA® GameWorks™ Documentation Rev. 1.0.200605 ©2014-2020. NVIDIA Corporation. All Rights Reserved.