NDK

NDK/JNI: identifying current thread

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In a JNI native method, is there a way to know the ID of the current thread without calling Java back? Thread-local storage would also work. EDIT: pthread.h is present in the NDK include folder... Does anyone know if Java threads correspond to POSIX ones in the NDK implementation? 回答1: Which ID are you interested in? A Dalvik thread dump includes this: "main" prio=5 tid=1 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x40017730 self=0x12798 | sysTid=3167 nice=0 sched=0/0 cgrp=default handle=-2146114456 | schedstat=( 358850000 275073000

Getting warning “NDK is missing a 'platforms” directory.' with no NDK [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: How to fix android studios 2.3 NDK bug? 8 answers I've got a project that only uses the Android SDK, not the NDK, but I'm getting warnings whenever I build with gradle about the NDK: NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /usr/local/opt/android-sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. Seems like a pretty clear

Android NDK - NativeActivity vs JNI lib

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: two years ago i developed an Augmented Reality framework on android-7 (Eclair) . Since AR application are computationally intensive task, I developed a JNI c++ library used by a Java activity to render and register the virtual environment. The sensor readings acquired in Java are passed to the underline c++ library to compute the registration of the virtual environment. Tridimensional objects are rendered by a native draw function called from a GLSurfaceView . This results in a lot of JNI call. Now I would like to port the

Android NDK: calling java method from JNI C class

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have JNI method where I am trying to call Java method. Here is my JNI code void DummySink :: afterGettingFrame ( unsigned frameSize , unsigned numTruncatedBytes , struct timeval presentationTime , unsigned /*durationInMicroseconds*/ ) { __android_log_print ( ANDROID_LOG_VERBOSE , "RTSP" , "Frame: %c" , propRec -> sPropBytes ); jmethodID mid ; jclass handlerClass = env9 -> FindClass ( "ob/android/Stream" ); if ( handlerClass == NULL ) { __android_log_print ( ANDROID_LOG_VERBOSE , "RTSP-Error" , "Class" ); } mid = env9 ->

Does/Will Google support NDK C++ crashes in Firebase Crash Reporting?

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have tried to find out from the documentation whether Google is supporting NDK C++ crashes in the newly released Firebase Crash Reporting . So far I have seen only Java crashes support. Does any one know if Google is planning to add support in the near future. 回答1: In the initial beta version, Firebase Crash Reporting only supports collecting Java crashes (on Android). Can't make any comments on future support, but its certainly an important area to consider for us. 回答2: After google's acquisition of fabric and their claim that

Android undefined reference with NDK

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to implement code from here When trying to compile it, I get these errors: Error:(339) undefined reference to `ANativeWindow_fromSurface' Error:(340) und Error:(349) undefined reference to `ANativeWindow_setBuffersGeometry' Error:(351) undefined reference to `ANativeWindow_lock' Error:(353) undefined reference to `ANativeWindow_release' Error:(406) undefined reference to `ANativeWindow_unlockAndPost' Error:(407) undefined reference to `ANativeWindow_release' Error:error: linker command failed with exit code 1 (use -v to see

Can we use System IPC in android NDK code

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here I want to use System IPCs methods like <sys/msg.h> /* SysV message queues */ <sys/ipc.h> /* General IPC definitions */ Here my android NDK code is in C language and I used message queue IPC mechanism for communication for other C application. So please Let me know is there any way to achieve this IPC goal? How can I implement this IPC mechanism in android NDK code? 回答1: One year ago I wrote a survey about this topic. Here is a part of it: 2 Unix IPC mechanisms Unix IPC mechanisms include: Unix signals. Unix pipes. Unix domain sockets.

Android NDK: Assertion failure: TARGET_PLATFORM is not defined

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When using NDK r5b, when I do a build in my jni directory using $NDK_DIR/ndk-build it works fine. But When I switch to r6b (just by setting $NDK_DIR differently) and run that same command, I get /usr/local/android-ndk-r6b/build/core/setup-toolchain.mk:20: *** Android NDK: Assertion failure: TARGET_PLATFORM is not defined . Stop. What do I need to do differently in r6b that I didn't need to do in r5b? 回答1: The solution is to add this line to jni/Application.mk: APP_PLATFORM := android-8 This is new to r6b. (Not required in r5b or r6, just r6b

crtbegin_so.o missing for android toolchain (custom build)

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have compiled gdc together with gcc using the android build-gcc.sh script, and have included a new stub in build/core/definitions.mk to deal with D language files as a part of the build process. I know things are compiling OK at this point, but my problem is linking: When I build a project, I get this error: ld: crtbegin_so.o: No such file: No such file or directory This is true for regular c-only projects as well. Now I ran a quick find in my build directory, and found that the file (crtbegin_so.o) does exist within the sysroot I

WebRTC building for arm

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to build webrtc for my small machine with arm926ej-s processor. After I install depot_tools, I did following steps: gclient config http://webrtc.googlecode.com/svn/trunk gclient sync --force cd trunk ninja -C out/Debug All working fine and I can run some binary files, which I get after compiling. Now, I want to compile for my arm machine. I do following: rm -rf out export GYP_CROSSCOMPILE=1 export GYP_DEFINES="target_arch=arm arm_float_abi=hard" export CC=/path/to/my/gcc export CXX=/path/to/my/g++ export AR=/path/to/my/ar export CC