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++.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

Undefined symbol when linking static library to Android NDK

I'm using a Gradle project provided by the SDL repository to use with Android builds. On its own, the project builds fine with full access to SDL. But I have a static library that I'm trying to link ...
Makoren's user avatar
  • 321
0 votes
1 answer
61 views

Creating temporary files from native code in C++ in Android

I am working on an Android project having native libraries in C++. Somewhere in the code, I encounter this line which tries to create a new file: namespace fs = boost::filesystem; dest_path = fs::...
Vivek Mangal's user avatar
-1 votes
0 answers
26 views

Routing audio via USB while receving MIDI [closed]

I'm working on a Android synthetisizer using aaudio and aamidi, currently it can receive midi messages from usb connection, Searchin about routing audio via USB while receving MIDI messages on Android ...
Massimo Vantaggio's user avatar
0 votes
0 answers
16 views

How do I define a custom class with Parcelable using Stable AIDL?

With the introduction of Stable AIDL, defined parcelables are required to be structured (Parcelables with their fields defined in AIDL are called structured parcelables). https://source.android.com/...
wic's user avatar
  • 11
0 votes
0 answers
35 views

Undocumented AMOTION_EVENT_ACTION code when stylus button pressed (Samsung S Pen Stylus)

The Android NDK Input Docs there are 15 AMOTION_EVENT_ACTION types, which are enumerated 0 to 14 as can be seen in the summary section when scrolling down. However, I observe the following behavior: ...
GimbaAghDurba's user avatar
0 votes
0 answers
10 views

How do I compile libgit2 for Android

recently I've been working on a flutter app, which uses libgit2 and I had no issues compiling the libgit2 repo for linux. Now, I would like to add support for android, so I tried to compile it using ...
Jakub Slabý's user avatar
0 votes
0 answers
33 views

expo run:androind ndk version cannot be changed

Im running into an issue with Expo where repeatedly receiving the following error msg: > Configure project :expo-modules-core C/C++: Platform version '33' is beyond '31', the maximum API level ...
Szilágyi István's user avatar
-1 votes
0 answers
36 views

Build DirectXShader Compiler for android

I want to compile the DirectX shader compiler for Android (I need dxcompiler.so). I found an Android.cmake in the repository and some "minimalistic" way to build. Since the file was added 7 ...
MarkaRagnos0815's user avatar
0 votes
0 answers
12 views

Enable obfuscation with NDK

I am trying to enable obfuscation like ollvm for android ndk but fail. Can somebody who already did it tell me how to do this easily?
theArt's user avatar
  • 21
0 votes
0 answers
22 views

native socket only sends data on Android once closed

The server is a kotlin app running on an Android 11 armeabi-v7a device. This is the relevant part of the server class: class MySock :Activity() { private val logName : String = "ServerSocket&...
vesperto's user avatar
  • 823
-1 votes
1 answer
30 views

Is it possible to use postgresql libpq in android?

I'm developing an app using android ndk in c++. How can I use the libpq library client in Android? I'm unable to find the libpq for ARM, so, is it possible to compile it for ARM? I tried using Visual ...
diego.martinez's user avatar
0 votes
0 answers
13 views

how to use protocbuf in ndk

what needs to be done so that the compiler does not complain about include in .pb.h files I downloaded the latest version of Windows x 64. I uploaded it to drive C. I wrote it in the path. Used a ...
Eliz Ysiliv plakapenka's user avatar
0 votes
0 answers
21 views

Accessing raw image sensor buffer with android NDK at different resolutions

I'm trying to write a simple camera app for android that is able to record raw videos, I'm using the NDK camera api and a codec written in c++ that can save the raw (bayer filter array) images. The ...
bose's user avatar
  • 1
0 votes
1 answer
33 views

What's the oldest SDK i can target on Android?

I currently have this in my build.gradle: android { defaultConfig { minSdkVersion 19 targetSdkVersion 21 which translates into <uses-sdk android:minSdkVersion="19" ...
vesperto's user avatar
  • 823
-1 votes
0 answers
32 views

OpenGL FrameBuffer Fail on Android NDK C++

I'm trying to create cubemap with 5 mipmaps but it doesn't work some of the android devices, even some of the decent phones glGetError() or glCheckFrameBufferStatus() gives ...
Anılcan Gulkaya's user avatar
0 votes
0 answers
17 views

Address Sanitizer for Process Injection

has anyone done any process injection address sensitization before? I am trying to get some debug output of any memory leaks and overflows in ASAN from injecting my code into a process, and I was ...
ANSOLO's user avatar
  • 35
0 votes
0 answers
28 views

Attach debugger for native code via command line

I want to debug C++ code in Firefox for Android and got things working with Android Studio following the guide "Debugging Native Code in Android Studio" from the Firefox Docs. While this is ...
DenverCoder21's user avatar
0 votes
1 answer
31 views

How does Android's ImageWriter work under the hood?

I have a custom Camera2 OpenGL pipeline to process frames from a Camera device. I have two target EGLSurfaces that I just send the EXTERNAL_OES OpenGL texture to using a pass-through Shader. This is ...
mrousavy's user avatar
  • 893
0 votes
0 answers
23 views

AHardwareBuffer_lock is insanely slow; takes 25ms+

I'm trying to get an android.media.Image's raw pixel content to the CPU. I wanted to use HardwareBuffers for this as it seems like those are the direct GPU memory frames, but it turns out they are 10x ...
mrousavy's user avatar
  • 893
0 votes
0 answers
30 views

"UnityException: Android NDK not found" On Jenkins Compile

The Log said: Android PostProcess task "Detecting Android SDK" took 3004.9653 ms DisplayProgressbar: Detect Android NDK UnityException: Android NDK not found Android NDK not found or invalid....
xirui yu's user avatar
0 votes
0 answers
43 views

NDK google sample keeps crashing at startup: native-activity sample

I need to understand how to handle touch events from the C++ side for a graphics application I am writing in Vulkan. Yet, when build and try to run this sample https://github.com/android/ndk-samples/...
gmmo's user avatar
  • 2,537
0 votes
1 answer
28 views

Android: Custom NDK/C++ android.media.Image implementation backed by OpenGL texture/HardwareBuffer

I'm working on a Camera2 app where I have a custom OpenGL pipeline set up for processing video frames. In my pipeline, I use a couple of different third party frame-processing APIs that expect an ...
mrousavy's user avatar
  • 893
0 votes
1 answer
75 views

"clang compiler does not support -march=armv8.2-a+i8mm" during TensorFlow lite for Android selective build

I'm trying to do a selective build of the TFLite Android runtime (in order to avoid a 100MB dependency for my app), and I'm running into a clang: error: the clang compiler does not support '-march=...
Daniel DeKlotz's user avatar
0 votes
0 answers
14 views

How to add resources to APK in visual studio 2019 android NDK project?

I created a native activity project in VS2019 but I can't find how to set the resource directory to be copied in the apk.
diego.martinez's user avatar
0 votes
0 answers
28 views

Android ASAN llvm-symbolizer cpp function

So I found this blog that explains how you would call the llvm-symbolizer binary for understanding which lines of code cause violations (buffer overflows, use-after-free, etc.): https://www.nrbtech.io/...
ANSOLO's user avatar
  • 35
0 votes
0 answers
22 views

Build Tensorflow Lite for Android NDK/C++ [duplicate]

I'm trying to use Tensorflow Lite in a purely native C++/NDK Android app. How do I build Tensorflow Lite for NDK/C++? I want to integrate the library using CMake and don't need any Java parts.
mrousavy's user avatar
  • 893
-1 votes
2 answers
32 views

'open' called with O_CREAT or O_TMPFILE, but missing mode

On Linux I open a file with the following code: auto file = ::open("file.dat", O_RDWR | O_CREAT); but when I try to compile this code for Android (android-ndk-r26-beta2) I get the following ...
Alexey Starinsky's user avatar
0 votes
0 answers
23 views

Android NDK (GameActivity) and main loop polling rate

I have a simple Game Activity and I am using the default code. It looks like the polling rate of the loop, as measured like this, is around 2 microseconds. Is it normal? I was wondering where to put ...
Brunni's user avatar
  • 143
0 votes
1 answer
38 views

In Android, having a file descriptor, how can you open a file with fopen in the C NDK?

Having obtained a file URI from a file picker (based on this: https://developer.android.com/training/data-storage/shared/documents-files) in Android, I am now trying to open that file from the NDK in ...
Mary's user avatar
  • 5
-1 votes
1 answer
18 views

How do I keep Android Studio from Indexing my home directory?

I have a large Android Studio NDK project. A while ago, it started taking hours to open and I could not figure out why. Today I notices on the file view that the root is now for some reason considered ...
David's user avatar
  • 1,658
0 votes
0 answers
60 views

NDK at C:\Users\theUser\AppData\Local\Android\Sdk\ndk-bundle did not have a source.properties file

I am coding in java language, i am facing this issue when i run the code. I have also tried to install new NDK but it didn't work. Check this screenshot. I have tried to write NDK version in gradle ...
Amaan Ahmad's user avatar
0 votes
1 answer
49 views

Why my Java class methods are not being called from the native code? JNI, NDK/SDK

I am developing an app NDK/SDK in Android Studio and want the Android while running my app to show the menu of the write permissions so the user can activate it. But my Java class methods(MainActivity....
خلیل ترابی's user avatar
0 votes
1 answer
41 views

Could not get unknown property 'ANDROID_NDK' for task ':app:cargoBuildDebug' of type org.gradle.api.tasks.Exec

What went wrong: A problem occurred evaluating project ':app'. Could not create task ':app:cargoBuildDebug'. Could not get unknown property 'ANDROID_NDK' for task ':app:cargoBuildDebug' of type org....
Machindra Bade's user avatar
0 votes
1 answer
41 views

How to pass variables for the Android C/C++ NDK from Android to C

Having a variable in Java, how can one assign that variable from C? I have tried passing the variable as a parameter to the function, but I don't know how to do that. Here is what I tried: in the Java ...
Mary's user avatar
  • 5
0 votes
1 answer
63 views

Error building/deploying test project (build: Android Qt 6.4.2 Clang arm64-v8a)

I can't compile a C++ (Qt) project for Android. The project is being compiled under Linux, but when I compiled my library under arm64-v8a, and then compiled the project, qt gives an error: error: ...
Misha Makovka's user avatar
0 votes
0 answers
24 views

Design an Android Service like Watchdog For collecting logs from remote devices and upload it to server

I want to create a bug reporting service in android which collects logs of crashes, ANRs and similar events. It should collect logs for Apps/JAVA Services/Native Services. I'm not sure which direction ...
Sameep Sharma's user avatar
0 votes
0 answers
55 views

Gluon Build for android doesnt work on linux-aarch64

I'm trying to generate a native image for Android profile using Linux with architecture aarch64 and I installed the GraalVM Version info: 'GraalVM 22.1.0 Java 17 CE' from this page https://github.com/...
heno's user avatar
  • 1
0 votes
1 answer
25 views

Native Library working correctly for install-time module but doesn't work as expected for on-demand module

I'm trying to localize an app that uses Native C++. Most of the codes written in C++ and all strings/text was in certain build flag. E.g LANG_JP // For japanese I've created an on-demand dynamic ...
pleasebugmenot.mrg's user avatar
1 vote
0 answers
56 views

I am getting warning "W Unable to open libbeluga.so: dlopen failed: library "libbeluga.so" not found." on xiaomi device

I would like to know if this is something to solve or not. When I searched guthub I found that multiple projects had this in their logs in some bug reports but none was dealing with it as an issue. I ...
Renetik's user avatar
  • 5,925
0 votes
0 answers
35 views

linker error in Android NDK r25c when cross-compiling FFmpeg

I am cross compiling FFmpeg for Android(aarch64) using Android NDK r25c on Linux x86_64 platform. The errors generated by the linker are because of enabling the LTO option. On disabling the LTO ...
Sai Chaithanya's user avatar
1 vote
1 answer
71 views

React Native Android C++ TurboModules static C library linking problems

I was trying to link a C static lib with an RN Android C++ TurboModules project via CMakeLists and got blocked by errors. From my understanding, libc should be provided OOTB, but it's not linking ...
Teodor Ciuraru's user avatar
0 votes
1 answer
90 views

Some files in a library fail to linlk to spdlog but others do

I'm running into something rather weird and I'm not sure how to get to the bottom of it. I'm using spdlog as a library. My code is split into two libraries, one called NativeUtils which is built as a ...
Kartik Aiyer's user avatar
0 votes
0 answers
68 views

How do I generate an apk file from shared library (.so) files?

I am trying to develop an Android app using purely C++. I am following this guide, which uses the android ndk. The last step is building the project with the script ndk-build : Build and install your ...
user avatar
0 votes
1 answer
71 views

Unable to load native library / undefined symbol: ANativeActivity_onCreate

I am using Android Studio to make a native Android app. I can build the program, but it crashes instantly when I run it to the emulator. In the location ${ANDROID_NDK}/sources/android/native_app_glue, ...
AdrianHEY's user avatar
  • 155
1 vote
1 answer
18 views

Android NDK app crashed when linking with OpenMp

In the Android NDK project, I linked with OpenMp in CMakeLists.txt by find_package(OpenMP) if (OPENMP_FOUND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(...
kstn's user avatar
  • 559
0 votes
0 answers
67 views

How to fix NDK issues in VSCODE?

I've installed NDK manually in my andriod studio. But still when i'm trying to run my app in VSCODE, it's showing the below msg of installing NDK. Can anyone give me a proper solution for it, please?...
Abu Bakkar Siddik Rana's user avatar
0 votes
0 answers
17 views

Trying to access file using native code. Error:filesystem error: in directory_iterator::directory_iterator(...): Permission denied [.]

I'm trying to get access to a file in my app's data folder form native code. It is not able to access because of some SE Linux Policy. I also have all files access permission too. This is the code ...
Ronith's user avatar
  • 1
-1 votes
1 answer
106 views

Using make to setup openssl results in "Please run the same make command again"

Im making an ndk build for android, but I need to do https requests so im using openssl. I wanted the setup of the project to be automatic but I keep getting "Please run the same make command ...
Cleardd's user avatar
  • 31
0 votes
0 answers
8 views

How about android ndk AMediaCodec decoding data saved as yuv I420 file?

AMediaCodecBufferInfo info; ssize_t index = AMediaCodec_dequeueOutputBuffer(ylMediaDecode->getAMediaCodec(), &info, 3000); if (index >= 0) { uint8_t *buffer = ...
user6267530's user avatar
0 votes
1 answer
13 views

aaudio - Stereo output

following this great tutorial Android Making Waves I'm finally able to facing with cpp dsp programming using AAUDIO lib for low latency audio. this tutorial explain how to archive monophonic sound, by ...
Massimo Vantaggio's user avatar

1
2 3 4 5
271