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

getting 'ninja' error while cleaning project in android studio MacOS

I am using Android Studio 3.5 in macos mojave I had a project containing both java and ndk code in a folder, lets call it "project_folder_A" I made a copy of this folder, renamed it to "project_folder_B" and continued to make modifications;…
user13267
  • 6,871
  • 28
  • 80
  • 138
5
votes
1 answer

Invoking native functions of ported library

i have been following this guide on how to port the LAME library with and Android NDK. http://blog.libertadtech.com/2011/02/porting-lame-encoder-to-android-arm.html Every worked fine an i got the libmp3lame.so file. Now for a first test i wanted to…
Goddchen
  • 4,459
  • 4
  • 33
  • 54
5
votes
4 answers

macOS cannot verify the developer of "clang"

I updated to macos-catalina and I am trying to crosscompile c++ code for android using android-ndk-r18b macOS cannot verify the developer of “clang". Are you sure you want to open it? It asks me for all different executables/compilers (e.g…
Julian
  • 909
  • 8
  • 21
5
votes
2 answers

Can a bluetooth 4.0 device send data to a bluetooth 2.0 device?

Is it possible for a Bluetooth 4.0 chip to interact with an Android phone with Bluetooth 2.0 via the Android SDK support for Bluetooth?
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
5
votes
2 answers

Error while uploading symbols to Firebase Crashlytics

I set up a firebase project with crashalytics and I can see Java and NDK crashes on the Dashboard. I am trying to upload symbols as per https://firebase.google.com/docs/crashlytics/ndk-reports#upload_native_symbols. I also tried following blogs like…
Harkish
  • 2,262
  • 3
  • 22
  • 31
5
votes
1 answer

Android cmake arguments method not found

I am trying to add arguments to cmake in order to follow the Android NDK instructions for using the address sanitiser. In the build.gradle file for the native module I therefore have the following: externalNativeBuild { cmake { …
Timmy K
  • 291
  • 1
  • 2
  • 14
5
votes
2 answers

How do I perform "Build/Refresh Linked C++ Projects" from command line?

I have an Android/NDK application and a build script which uses gradlew.bat to automate build/install. The build.gradle uses CMakeLists.txt and GLOB_RECURSE internally in order to build the C++ files. However, if I add a new .cpp file to my C++…
5
votes
0 answers

startactivty intent not work with error SurfaceFlinger: duplicate layer name

I'm trying to use 3rd party library in android which has PaymentActivity starting to make a payment here is the code : @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Amin
  • 463
  • 2
  • 11
  • 29
5
votes
1 answer

Android NDK linker error 'Undefined reference to std::ios_base' when using FreeImage

I am trying to statically link against the open frameworks build of libfreeimage.a for the Android NDK (using the native-activity sample as a template). When I compile and link my project I get a lot of linker errors along the lines…
Mike
  • 111
  • 1
  • 1
  • 5
5
votes
1 answer

Alternative gettext lib in C?

I have an Android NDK project entirely in C. I have a bunch of .po files, and libintl configured currently. Unfortunately, according to a Google dev, it looks like I am SOL expecting to use gettext in my project, as Android doesn't support setting…
user213345
5
votes
3 answers

How can I fix this fatal exception?

I am porting my C/C++ code into an Android Game using the NDK, but I'm having trouble getting started. I have downloaded the NDK-r5b from developer.android.com and I have installed Cygwin. I am not even able to run the Hello-jni program provided…
5
votes
2 answers

GStreamer on Android

Can anyone give me any tips on getting GStreamer to work on Android. I have never used it before and I would like to use it with FFmpeg (I already have FFmpeg compiled and works fine on Android). I would just like to use GStreamer to help with some…
DRiFTy
  • 11,269
  • 11
  • 61
  • 77
5
votes
1 answer

How to change ndk setting from default C++ toolchain to C++14 after project is created?

I created an Android project with default C++ toolchain. Now when I was trying to include code snippets from sample projects on oboe containing C++14 features I keep on getting errors. So I tried included code to create a template but now it is…
Mandar Sadye
  • 689
  • 2
  • 9
  • 30
5
votes
1 answer

Is there support for audio processing in oboe library for Android?

I am working on my android application project in which I am taking sound from the environment and processing it to remove noise and increase the amplitude of the signal. For that purpose, I am using this example project for oboe library sample…
Mandar Sadye
  • 689
  • 2
  • 9
  • 30
5
votes
1 answer

Fabric Crashlytics NDK stack backtraces missing frames

I have an Android Studio project that includes multiple native shared libraries. I followed the steps documented here to integrate Crashlytics NDK support and upload symbols to Fabric: https://fabric.io/downloads/gradle/ndk The crashes are…
1 2 3
99
100