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

"local symbol '__bss_start' in global part of symbol table" only in Android NDK aarch64 build

I'm creating an Android library with NDK (r19b) for arm, aarch64, x86, and x86_64. All is OK, except that when I build an app for aarch64 architecture, I get the following error message. ld.lld: error: found local symbol '_edata' in global part of…
solamour
  • 2,764
  • 22
  • 22
5
votes
1 answer

C++ shared libraries have duplicate symbols

I am new to c++ symbol tables and libraries, wanted to understand the behavior of symbol table. We are having an android application with native support on it. In process of analyzing symbol tables of shared libraries, I am noticing duplicate…
Teja
  • 109
  • 4
  • 12
5
votes
0 answers

Different behavior of Native C++ Android projects when using Java and Kotlin as a base language

I created two Native C++ projects - one with Kotlin as a base language, another one with Java. In both projects I made the same modification of the automatically-created C++ functions: extern "C" JNIEXPORT jstring…
IronHawk
  • 365
  • 3
  • 7
5
votes
5 answers

Problems at R.styleable while integrating native opencv to android studio

I'm addind openCV native lib into my (in developpement) project. I'm following this guide. I have troubles at the very last step, while building my project, in the OpenCV-android-sdk folder : CameraGLSurfaceView.java got error cannot find symbol…
Jérémy
  • 1,790
  • 1
  • 24
  • 40
5
votes
3 answers

How do I use lldb to debug C++ code on Android on command line

How can I debug my Android NDK project in C++, using the lldb debugger from the command line?
Scorb
  • 1,654
  • 13
  • 70
  • 144
5
votes
1 answer

Android NDK GCC appears to be clang - is it the way it should be?

A freshly downloaded NDK fails on linking old projects with error: /usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi As it appears, clang hides behind the mask of…
hutorny
  • 863
  • 11
  • 17
5
votes
2 answers

How to play decoded in-memory PCM with Oboe properly?

I use oboe to play sounds in my ndk library, and I use OpenSL with Android extensions to decode wav files into PCM. Decoded signed 16-bit PCM are stored in-memory (std::forward_list), and then they are sent into the oboe stream via a…
barsoosayque
  • 329
  • 2
  • 11
5
votes
0 answers

How can I use SIGRTMIN + X Signals in Andorid NDK for Usb ISOCHRONOUS Transfers

I am attempting to Submit ISOCHRONOUS URB in Android NDK in C. usbdevfs_urb& urbRequest = *(usbdevfs_urb*)malloc( 384 ); urbRequest.type = USBDEVFS_URB_TYPE_ISO; urbRequest.endpoint =…
5
votes
1 answer

For Android does CMAKE_SYSTEM_VERSION mean the minimum api level or the target api level?

When using CMake to build for Android, does CMAKE_SYSTEM_VERSION correspond to the minimum api level or the target api level?
Chanon
  • 383
  • 3
  • 8
5
votes
2 answers

React Native: Generating the Release Build APK error :app:mergeReleaseAssets FAILED

I am trying to create signed apk for a react native app. The debug app is working fine. I am following the react native guide for creating the signed APK. I have added the keystore to the app and set up the gradle variable, but unable to make signed…
Anurag Dhunna
  • 544
  • 1
  • 5
  • 17
5
votes
1 answer

Android NDK: Static or shared C++ runtime for 3rd-party Java library

I'm compiling a 3rd-party Java library for Android that uses JNI. I read the relevant pages on adding C++ support on developer.android but I'm still confused about a couple of issues regarding C++ STL runtime that I was hoping I could clear up…
solidak
  • 5,033
  • 3
  • 31
  • 33
5
votes
4 answers

C matrix libraries, suited for opengl on Android (NDK)

I'm writing a rendering routine in C using opengl es 2.0 with NDK. I'm interested in (speed over precision) libraries for graphical-transformations on matrices, and any best practises you can recommend. Writing my own functions is not improbable,…
LazyBitStream
  • 550
  • 5
  • 8
5
votes
1 answer

Is it possible to merge weak symbols like vtables/typeinfo across RTLD_LOCAL'ly loaded libraries?

For context: I have a Java project that is partially implemented with two JNI libraries. For the sake of example, libbar.so depends on libfoo.so. If these were system libraries, System.loadLibrary("bar"); would do the trick. But since they're…
Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118
5
votes
2 answers

Android Studio-NDK error: Cause: error=13, Permission denied

I am facing an error when I am compiling a repository in Android Studio: https://github.com/argos-research/android-OpenCV I get this error: Cause: error=13, Permission denied I also was not sure about NDK that is downloaded with new Android Studio,…
Yousef
  • 393
  • 8
  • 23
5
votes
1 answer

How to disable NDK for a certain project in Android Studio

I have multiple projects I'm working on, and some require NDK to be installed. When I do that in the SDK manager, all my non-NDK projects fail to generate the APK unless I removed NDK on the SDK manager. I tried specifying and removing the NDK path,…
Hey'Youssef
  • 285
  • 4
  • 15
1 2 3
99
100