native android development with nsight tegra november...
Post on 19-Jun-2020
11 Views
Preview:
TRANSCRIPT
NVIDIA Confidential
NATIVE ANDROID DEVELOPMENT WITH
NSIGHT TEGRA
NOVEMBER 2012
NVIDIA Confidential
Tegra Developer Tools Android Native Development Tools
NVIDIA Confidential
Tegra Developer Tools
Setup and configuration
No true integrated development environment (IDE)
Eclipse is unfamiliar and sometimes confusing
Tough to find developers with Eclipse experience
Command line debugging is slow and painful
Debugging in Eclipse can take seconds to step over a line of code
Code generated can be slow and buggy on certain devices
Where do you go for help?
Native Android Development Challenges
NVIDIA Confidential
Tegra Developer Tools
What is the Android NDK?
Use native-code languages (C/C++)
Implement portions or your entire
application using NativeActivity
Tools for generating and embedding
native code libraries
System headers and libraries for
managed resources
Android Native Development Kit?
What is the Android NDK NOT?
It is not a silver-bullet for
performance issues
It does not a replace the SDK
It is not meant for standard Android
applications
It is not an alternative programming
language option
NVIDIA Confidential
Tegra Developer Tools
To reuse existing C/C++ code
For portability
For vector floating point (vfp) and NEON
For high performance, CPU-intensive applications
Why use the Android NDK?
NVIDIA Confidential
Tegra Developer Tools
Java Native Interface (JNI)
Allows Java managed code to
interact with native code (C/C++)
Cumbersome, yet efficient
Two key data structures, "JavaVM"
and "JNIEnv”
How to access native code on Android?
NativeActivity
Pure native code, no java required
Intended for games (or game-like
things)
Simply declare in your manifest
“glue” code provided
NVIDIA Confidential
Tegra Developer Tools
HelloWorld.java class HelloWorld { private native void print(); public static void main(String[] args) { new HelloWorld().print(); } static { System.loadLibrary("HelloWorld"); } }
Java Native Interface (JNI)
libHelloWorld.c #include <stdio.h> #include "HelloWorld.h" JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj) { printf("Hello World!\n"); return; }
NVIDIA Confidential
Tegra Developer Tools
AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.demo.hellonative"> <!-- This is the platform API where NativeActivity was introduced. --> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" /> <!-- This .apk has no Java code itself, so set hasCode to false. --> <application android:label="@string/app_name" android:hasCode="False"> <!-- Our activity is the built-in NativeActivity framework class. --> <activity android:name="android.app.NativeActivity" android:label="@string/app_name"> ...
NativeActivity
NVIDIA Confidential
Tegra Developer Tools
Download and install . . . . . . the appropriate SDK package
. . . the appropriate NDK package
. . . the appropriate JDK package
. . . the appropriate Android APIs
. . . the appropriate Apache ANT package
. . . the Google USB Driver (if debugging)
. . . Eclipse
. . . C/C++ Support for Eclipse (ADT/CDT)
. . . Cygwin (Windows – optional, barely)
How to get started with the NDK?
OR . . .
NVIDIA Confidential
http://developer.nvidia.com/develop4tegra
Tegra Android Development Pack
CPU DEBUGGING with Nsight Tegra
GPU DEBUGGING with PerfHUD ES
OPTIMIZE applications with Tegra Profiler
REFERENCE docs, samples & tutorials
OPTIMIZED for Tegra Android development
FLASHES Tegra DevKit with OS Image
CONFIGURED for debugging and profiling
INCLUDES Kernel symbols and DS-5 support
For Windows, OSX and Linux
GET STARTED in minutes NOT hours
INSTALLS all tools required for Tegra Android
NVIDIA Confidential
Tegra Developer Tools Native Android Development
Nsight Tegra Native Android CPU debugging
Visual Studio and Eclipse integrations
Breakpoints in both Java and Native
PerfHUD ES Examine and debug OpenGL ES frames
Automated bottleneck analysis
Edit shaders at runtime
Tegra Profiler Maximize multi-core CPU utilization
Quickly identify CPU “hot spots”
Identify thread contention issues
http://developer.nvidia.com/develop4tegra
NVIDIA Confidential
Tegra Developer Tools
Key Benefits Visual Studio integrated Android development
Increased build and runtime performance
Multi-core native Tegra Android GDB debugging
Seamlessly debug Java and native C/C++ code
Manage and build Tegra Android applications
Familiar environment for Tegra Android development
Android specific features integrated into Visual Studio
Future integrated CPU profiling and graphics
development
Nsight Tegra, Visual Studio Edition
Available Q4 2012
NVIDIA Confidential
Tegra Developer Tools Nsight Tegra, Visual Studio Edition
Pricing & Availability
Nsight Tegra is freely available ($0) to members of the Tegra Registered Developer Program,
but requires a valid Visual Studio license.
System Requirements
Tegra consumer device or developer kit (root access not required)
Microsoft Visual Studio 2010 (sadly not Visual Studio Express)
Microsoft Windows 7
Android 3.0+ (Honeycomb+)
Support
Forums: http://devtalk.nvidia.com
Available Q4 2012
NVIDIA Confidential
Nsight Tegra Demonstration
http://developer.nvidia.com/NsightTegra
Android GDB debugging in Visual
Studio
Set breakpoints in both Java and
Native (C/C++)
Use the familiar Visual Studio
Locals, Watches, Memory and
Breakpoints windows.
Build native Android projects in
Visual Studio using vs-android,
ndk-build or makefiles.
NVIDIA Confidential
Tegra Developer Tools Nsight Tegra, Visual Studio Edition Roadmap
http://developer.nvidia.com/develop4tegra
Nsight Tegra 1.0 [Q3 2012]
Preview release
Nsight Tegra 1.1 [Q4 2012]
NDK r8b/r8c and UE3 support
Critical bug fixes
Nsight Tegra 1.x [2013]
Minimize time required to deploy (file sync)
Visual Studio 2012 / Windows 8 support
Full UE3 support
Visual Studio GDB console / ADB shell
Usability improvements (external
files/settings)
Workflow improvements (launch/deploy)
NVIDIA Confidential
The Tegra Registered Developer Program
Stephen Jones
sjones@nvidia.com
http://developer.nvidia.com/develop4tegra
top related