Questions tagged [android-ndk]

The Android Native Development Kit (NDK) is a companion tool to the Android SDK that lets build performance-critical portions of apps in native code or port existing libraries in C/C++ to Android. It provides headers and libraries that allows to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C/C++.

Android NDK applications that include Java code and resource files and and/or source code (and sometimes code). All native code is compiled into a dynamic linked library (.so file) and then called by Java in the main program using a mechanism:

Android NDK Application

The NDK is a powerful tool for developing Android applications because it:

  • Builds performance-critical portions of your applications in native code. When using Java code, the Java-based source code needs to be interpreted into machine language using a virtual machine. In contrast, the native code is compiled and optimized into binary directly before execution. With proper use of native code, you can build high performance code in your application, such as hardware video encoding and decoding, graphics processing, and arithmetical operation.
  • Reuses legacy native code. C/C++ codes can be compiled into a dynamic library that can be called by Java code with a JNI mechanism.

More information:

Latest Version: NDK Downloads

Version History: NDK Archives

Resources:

FAQ:

Books:

13539 questions
5
votes
2 answers

Sharing the EGL2.0 context between 2 GLSurfaceViews caused EGL_BAD_ACCESS on Android tablets

I try to share EGL context bwteen 2 GLSurfaceViews by following code: createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { EGLContext shared = ...; // a cached egl context int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2,…
5
votes
1 answer

Android NDK library: findLibrary returned null

I'm trying to build a medium-size project in Eclipse. It consists of main app project and two Android libraries. Everything worked fine until I added a very simple JNI library to main project. When I run the app on device I see this exception in…
Anton
  • 4,395
  • 7
  • 32
  • 46
5
votes
1 answer

How to output variable contents to "LogCat" window in Android-ndk

I am using Android-sdk-ndk in an Eclipse+ADT environment. In Android-sdk Java development, I could use "Log.i", "Log.w", ... statements to output messages and variable contents to the "LogCat" window. However, in Android-ndk C/C++ development, is…
user1129812
  • 2,859
  • 8
  • 32
  • 45
5
votes
2 answers

how to do memory and CPU time profiling in Android

Possible Duplicate: What Android tools and methods work best to find memory/resource leaks? I want to do memory and CPU time profiling of my Android application. And my application is using C source file also.So I want to do profiling on android…
geeta
  • 689
  • 3
  • 17
  • 33
5
votes
1 answer

SNMP library for android

Is it possible to create let's say an App that can run SNMP get and set query under any android version Or is there SNMP library for Android development? Regards, Paul
polino247
  • 51
  • 3
5
votes
2 answers

Building native library with standalone toolchain android arm

I am trying to build libraw as a Android shared library. It looks the lib is too complex to use with Android.mk etc, or better: I am not capable yet of doing that. I tried the route of using a standalone toolchain from the NDK, but I am getting…
Peterdk
  • 15,625
  • 20
  • 101
  • 140
5
votes
1 answer

Android: Most efficient way to pass some read-only bytes to native C++

I have an Android project (targeting Android 1.6 and up) which includes native code written in C/C++, accessed via NDK. I'm wondering what the most efficient way is to pass an array of bytes from Java through NDK to my JNI glue layer. My concern is…
occulus
  • 16,959
  • 6
  • 53
  • 76
5
votes
2 answers

NDK-Build how to rebuild project?

I am using a dual project structure cocos2d-x for windows and android, and using cygwin to build my project, at first it build the whole solution: build $ANDROID_NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT $* but in posterior builds it does not build…
Astronaut
  • 6,691
  • 18
  • 61
  • 99
5
votes
2 answers

Developing a 3D game on Android platform with Bullet physics engine

I want to develop a 3D game with a simple physics engine using Bullet. However Bullet was written in C++, so I propose to build it with ndk, and use the dynamic library to create my 3D physics world. I am unsure, precisely, how to approach this.…
whoseyourdady
  • 51
  • 1
  • 3
5
votes
2 answers

Unable to get high fps(frames per second) rate(around 30fps) while recording from front camera in my Android app

in my Android app, I observed that the video recorded from the front camera is being recorded with 7-10 fps while the back camera does the job fine, the native camera app does record video from front cam at 29fps. I use the following function to set…
Arif Nadeem
  • 8,524
  • 7
  • 47
  • 78
5
votes
2 answers

attaching to android native app with gdb closes app on device

I am attempting to debug my native app compiled with ndk-r6. When I attempt to run ndk-gdb to attach the debugger to the process, the app quits on the device. I am stumped. Can anyone shed some light on this for me please? Here is a log of a run of…
Tom Whittock
  • 4,081
  • 19
  • 24
5
votes
2 answers

Cannot write to ARM register R4: feature or bug?

I've recently encountered a strange behaviour of ARM Cortex-A8 when programming it in Assembly. Whenever I MOV anything into R4, my program crashes (stack dump below) 10-14 09:48:43.117: INFO/DEBUG(3048): Build fingerprint:…
Phonon
  • 12,549
  • 13
  • 64
  • 114
5
votes
1 answer

Boost C++ and Android 3

I tried to google and SO search. So far I was able to find only conflicting information. If it is too hard to marry Boost and Android, maybe there are replacements? I am especially interested in smart_ptr, threads, function, lexical_cast,…
pic11
  • 14,267
  • 21
  • 83
  • 119
5
votes
0 answers

crash in the application in libicuuc.so

I am facing crashes in the libicuuc.so file. Which is not part of myapplication. I have native code in the file libevrc.so (EVRC Codec). While decoding i am facing below crash. Googled and tried a log with the information i got on Google. But still…
Suman
  • 4,221
  • 7
  • 44
  • 64
5
votes
2 answers

eglQuerySurface gives wrong size

When I rotate my device and my app recieves APP_CMD_CONFIG_CHANGED, I attempt to update my OpenGL viewport with the following: EGLint width; EGLint…
IronMensan
  • 6,761
  • 1
  • 26
  • 35