android-ndk

How to open /dev/diag with super user permissions?

青春壹個敷衍的年華 提交于 2020-01-05 04:13:15
问题 I am developing an application for One Plus 6. This applications is using a shared library(lib.so) to perform some task. For the task it needs to open dev/diag first and then send some commands through code. Below is the code to open dev/diag: fd = open("/dev/diag", O_RDWR|O_LARGEFILE|O_NONBLOCK); if (fd < 0) { perror("open diag dev"); return -8002; } I am able to build a executable with include $(BUILD_EXECUTABLE) written in Android.mk and with ndk-build command. I am able to run open the

Bug in Android C++/C debugger, incorrect argument values

人盡茶涼 提交于 2020-01-05 02:47:16
问题 I have recently encountered a really weird problem while debugging C/C++ application in Android Studio. I am using Android Studio 3.0 Here is my JNI Call JNIEXPORT jshortArray JNICALL Java_net_crosp_android_library_ecgaudioprocessor_EcgSignalProcessorDemodulator_demodulate( JNIEnv *env, jobject instance, jshortArray readBuffer_) { /* get size of the array */ jsize len = env->GetArrayLength(readBuffer_); int sample_rate = 44100; int kd = 12; SignalConfiguration signal_cfg = {sample_rate, kd,

How to call a Java function via JNI from a signal handler function in Android

萝らか妹 提交于 2020-01-05 01:07:26
问题 My objective is to send a signal from kernel to a Android service running in the userspace.On receiving this signal, the service should make an IOCTL call back to the kernel. After it gets data from the kernel through this ioctl call,it has to display to the user. For this, i call a native method from my Java Service, which registers the sigaction structure, which includes the handler function for this signal. This handler function will make the IOCTL call and call a Java Function to pass the

Android NDK: Warning: There are no modules to build in this project

巧了我就是萌 提交于 2020-01-04 13:27:45
问题 I'm new in NDK development and I'm currently facing a problem, when I try to invoke the ndk build tool from cygwin terminal: Android NDK: WARNING: There are no modules to build in this project! I’m under windows (x64) and I use the r10d (64-bit) NDK. I try to invoke it from the root of my project that contains a jni folder with a simple .c file and an Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Here we give our module name and source file(s) LOCAL_MODULE := mycfile LOCAL

Changing package name android manifest causes problems JNI

送分小仙女□ 提交于 2020-01-04 09:07:53
问题 I have been modifying and playing around with this project: source code : https://bitbucket.org/viet0904163136/gba-android/src It's a gameboy advance emulator licensed under GPLv2. Every thing works ok until i change the packagename in the android manifest file. Without the package name changed the app works without a problem. But when the package name is changed the SDLactivity quits with this message: (i renamed it to com.gba.emu) 09-01 12:23:16.409: I/SDL(884): SDL_Android_Init() 09-01 12

Debugging Android JNI/C++ No Debug Symbols Found Target Machine Actively Refused Connection

爱⌒轻易说出口 提交于 2020-01-04 08:27:52
问题 Here is the console log: (no debugging symbols found) D:\ws\test\MyProject\obj\local\armeabi\gdb2.setup:4: Error in sourced command file: :5039: No connection could be made because the target machine actively refused it. localhost:5039: No connection could be made because the target machine actively refused it. Following debug steps for eclipse plugin sequoyah: http://www.eclipse.org/sequoyah/documentation/native_debug.php I'm almost at the end trying to connect the C++ Debugging. My Android

How to debug C++ code on Android by using Eclipse?

二次信任 提交于 2020-01-04 08:21:48
问题 I wrote some video streamer ( C++ ) on PC and now I try to to implement the same cross platform section on Android. I "played" enough with NDK and know a bit about how to compile and integrate C code with Android (aka JNI). The problem is that sometimes my application crashes and as you know Android doesn't point me where code failed (in C/C++ part). Video Streamer code have a lot of libraries and, lets say, open source parts I used so to leave logs - not good idea. I use Eclipse, how can I

Android NDK vs iOS - performance issue [closed]

心不动则不痛 提交于 2020-01-04 06:08:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I've been looking around for solution at least 2 days unsuccesfully so as my last hope I decided to ask it here. Here at work we have a C++ code base using OpenCV that we want to run both on iOS and Android. It turned out that the whole thing runs slower on Android and I can't

Android NDK vs iOS - performance issue [closed]

天大地大妈咪最大 提交于 2020-01-04 06:08:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I've been looking around for solution at least 2 days unsuccesfully so as my last hope I decided to ask it here. Here at work we have a C++ code base using OpenCV that we want to run both on iOS and Android. It turned out that the whole thing runs slower on Android and I can't

Gradle can't find OpenCV Libraries for debugging with NDK

扶醉桌前 提交于 2020-01-04 05:28:22
问题 I've been developing Android apps with C++ code by just executing ndk-build . I've always used OpenCV, so in my Android.mk there was: include $(CLEAR_VARS) OPENCV_LIB_TYPE:=SHARED OPENCV_CAMERA_MODULES:=off OPENCV_INSTALL_MODULES:=on include /Users/rafaelruizmunoz/Desktop/Android_Tools/OpenCV-2.4.9-android-sdk/sdk/native/jni/OpenCV.mk include $(OPENCV_PATH) and it's been working good. Now I want to debug the C++ code with Android Studio, and I had to do some modifications in the gradle. The