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
30
votes
9 answers

NDKBuild Failure

I'm having trouble getting my NDK to compile properly in Android Studio. Whenever I try running to compile I am getting the following error. Error:Execution failed for task ':app:ndkBuild'. A problem occurred starting process 'command…
Valrok
  • 1,514
  • 7
  • 30
  • 49
30
votes
5 answers

Android App Crashes Suddenly while running?

What my App does ? The App I am developing is a typical client server App which talks to a windows server using Wifi. The Application has multiple Activities and really has heavy memory and CPU requirements i.e native calls for speex encoding /…
Amit
  • 13,134
  • 17
  • 77
  • 148
30
votes
3 answers

How can I use BitmapRegionDecoder code in android 2.2.2 (Froyo)?

I was reading an answer to a different question on SO, in which @RomainGuy commented that one could (please correct me if I'm paraphrasing incorrectly) back-port code from later versions of android to earlier versions. Specifically, I am interested…
snapfractalpop
  • 2,086
  • 2
  • 21
  • 28
29
votes
2 answers

Access camera via OpenMAX in Android

I currently try to figure out how to access the Camera via OpenMAX in Android 4.0. The documentation is not sufficient for me so I currently struggle with how I can retrieve the correct XADataSource for the following…
abergmeier
  • 13,224
  • 13
  • 64
  • 120
29
votes
4 answers

WARNING: ABIs [armeabi-v7a,armeabi] set by 'android.injected.build.abi' gradle flag contained 'ARMEABI' not targeted by this project

I had this issue last time after upgrade NDK version to latest version in Android Studio. I also found solution to fix this. If anyone has this issue , I hope it is the best question and answer for you. Please check my answer.
Chivorn
  • 2,203
  • 2
  • 21
  • 37
29
votes
1 answer

The ant/ folder is suddenly missing from Android SDK. Did Google remove it?

I've tried compiling libreoffice core project (choosing Android module) (with make, no Gradle involved yet), and I'm getting this error: /home/aleksandar/libreoffice/workdir/UnpackedTarball/owncloud_android_lib/build.xml:90: Cannot find…
Aleksandar Stefanović
  • 1,583
  • 2
  • 20
  • 36
29
votes
4 answers

MP3 Decoding on Android

We're implementing a program for Android phones that plays audio streamed from the internet. Here's approximately what we do: Download a custom encrypted format. Decrypt to get chunks of regular MP3 data. Decode MP3 data to raw PCM data in a…
Rob Szumlakowski
  • 947
  • 3
  • 8
  • 18
29
votes
3 answers

Fatal signal 11 (SIGSEGV) code=2 on genymotion emulator not using NDK

My application does not use NDK. I am testing it on the GenyMotion Nexus 7 emulator and the problem is quite hard to reproduce and I still haven't figured out a correct way to reproduce it. Sometimes the application works fine for a long time and…
VM4
  • 6,321
  • 5
  • 37
  • 51
29
votes
3 answers

Unable to launch cygpath in android

When i am trying to import a project to my workspace it shows an error [2013-03-17 16:14:15 - Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, The system cannot find…
jithu
  • 706
  • 1
  • 9
  • 13
28
votes
1 answer

Android Video Player Using NDK, OpenGL ES, and FFmpeg

Ok so here is what I have so far. I have built FFmpeg on android and am able to use it fine. I have been able to load a video into FFmpeg after passing the chosen filename from the java side. To save on performance I am writing video player in the…
DRiFTy
  • 11,269
  • 11
  • 61
  • 77
28
votes
4 answers

How to set NDK Build path in OSX for Android studio

I had set the ANDROID_NDK_HOME as /Users/Shajilshocker/Documents/Android/NDK/android-ndk-r10b using a mac osx application called Environment Variables. I had confirmed that it set the path correctly in Terminal echo $ANDROID_NDK_HOME But when I run…
Shajo
  • 873
  • 2
  • 11
  • 22
28
votes
2 answers

Android NDK: Including boost c++ library

I am trying to use a boost library inside my android application, using the NDK. I have found a couple of success stories here and here, but I can't say the same about me. I am specifically trying to use the library in this link, as well as the…
naxchange
  • 893
  • 1
  • 11
  • 24
28
votes
2 answers

How to target multiple architectures using NDK?

Background I've recently started to develop some code using the NDK, and I've thought of a possible portability problem that could occur while developing using NDK. The problem Since NDK uses native code, it needs to be compiled per CPU…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
28
votes
13 answers

Compiling the latest OpenSSL for Android

I am trying to generate the shared library for the (.so) files of the OpenSSL1.0.1c for the Android. I found that they have added three options for compiling for the Android in the android script. ./Configure android-armv7 (or) ./Configure…
Suman
  • 4,221
  • 7
  • 44
  • 64
28
votes
3 answers

Set Build path in Eclipse for ndk program

This error was shown when I build a android application program in Eclipse: 14:43:33 **** Incremental Build of configuration Default for project com.***.NDKDemo **** ndk-build all Cannot run program "ndk-build": Unknown reason Error: Program…
TamiL
  • 2,706
  • 4
  • 24
  • 44