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
1 answer

android ndk-gdb fails to load symbols

Using android-ndk-r7b/samples/hello-jni as a debugging starting point, I built the jni with ndk-build V=1 NDK_DEBUG=1 rm -f ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/x86/lib*.so rm -f ./libs/armeabi/gdbserver…
Paul
  • 217
  • 3
  • 12
5
votes
4 answers

Issue with build Android NDK project

I try to build project in Eclipse on Linux Ubuntu. Eclipse show error message: **** Build of configuration Default for project FFVideo **** /home/art/android-ndk-r7b/ndk-build V=1 Cannot run program "/home/art/android-ndk-r7b/ndk-build": Unknown…
ArtKorchagin
  • 4,801
  • 13
  • 42
  • 58
5
votes
2 answers

Change Activity with JNI Call or using Openfeint causes App-Crash

I have a huge problem when I want to change the Activity of my Android-Application with a JNI call from my C++ Code. The App uses cocos2d-x for rendering. The concrete situation is that I want to open the OpenFeint-Dashboard in Java using this very…
5
votes
0 answers

Improve FloatBuffers' Performance with Native C/C++

I'm writing an OpenGL ES 2.0 Engine and using FloatBuffers, but I've heard FloatBuffers are slow on Android Froyo and moderatly quicker on Gingerbread. So what I want to know is, whether it's possible to create and edit buffers with native…
Martin Erhardt
  • 581
  • 11
  • 23
5
votes
4 answers

ndk-gdb: “No symbol table is loaded”

I'm still with ndk-gdb, now trying to solve the main problem that leaded me to do the other question I self answered xD ndk-gdb tells me that there is no symbols table for my current lib. This is like the file I'm debugging where not the same as the…
Adrián Pérez
  • 2,186
  • 4
  • 21
  • 33
5
votes
1 answer

Android Native NDK OpenGL ES: unimplemented API

I am working to implement an OpenGL ES 2.0 fully in C++ for Android. Currently our program runs without JNI or any java class in the project, using instead only NativeActivity. Focusing on the application rendering part itself, we got a simple…
ThreaderSlash
  • 1,313
  • 3
  • 27
  • 43
5
votes
0 answers

Is there a port of ImageMagick available for Android?

I want to use the ImageMagick as a library in an Android app. I've tried lilac's ImageMagick build and also looked at this question but I was not able to build the library. I found a solution to compiling the library here but the demo application…
biztiger
  • 1,447
  • 4
  • 23
  • 40
5
votes
1 answer

Application exit automatically without any warning or error

I have developed application for OCR using tesseract Library, Application got exit during the execution of following code : /*... ... Other Code stuff ...*/ protected Boolean doInBackground(String... arg0) { /*... ... Other Code stuff …
5
votes
1 answer

android.permission.BATTERY_STATS api

I want more information about android.permission.BATTERY_STATS . what possibilities grants the permission android.permission.BATTERY_STATS. I know how to use it if I can read the android.intent.action.BATTERY_CHANGED intent for the battery levels…
user1226604
5
votes
2 answers

How do i install Android NDK on Windows OS? without any Unix Linux stuff the easy way?

I am struggling to install the Android NDK on windows for a few day's , can someone explain the easy way with image tutorial and explanations how to install it? How i would be able to use the C/C++ in my Android applications??? PS: I do not know how…
hackp0int
  • 4,052
  • 8
  • 59
  • 95
5
votes
1 answer

Android native project referencing shared library from c++ library project

I have 2 projects: 1 - Android Native project 2 - C/C++ Project I'm building my shared library files (.so) in a C/C++ project and want to use those .so files in Android Native project. I don't want to copy and paste these library files from one…
user831170
5
votes
1 answer

JNI on Android: How to retrieve a string from Java code?

I read a lot of examples to retrieve a java string in C/C++ code, but it seems that I miss something. this simple code doesn't work.. In ActivityTest (android java code) I've: public static native void nativeInit(String stringfromjava); In…
Giuseppe
  • 2,093
  • 1
  • 21
  • 26
5
votes
1 answer

No JNI_Onload() found and VM shutting down

I am new to Android , I followed the instructions on the link http://marakana.com/forums/android/examples/49.html to create the basic application using NDK. I followed those steps exactly. I also created the shared library. When I run the…
Chandu
  • 91
  • 2
  • 8
5
votes
1 answer

Linking failing for PCRE when using Android NDK stand-alone toolchain

People have been able to build PCRE (or a subset of) by copying the source files and creating appropriate Andriod.mk. I want to do similar, but using an Android stand-alone toolchain and just using their configure and make process. I have had…
corbin
  • 1,446
  • 2
  • 27
  • 40
5
votes
2 answers

'configure' failing with Android NDK standalone toolchain

I'm trying to build something with the Android NDK standalone compiler toolchain, but I'm getting this error: Updating bundled third-party dependencies... bash -c 'mkdir -p…
Anders Feder
  • 595
  • 2
  • 5
  • 18