Category : android-ndk

I want to handle left and right swipe gestures, but this code doesn’t work. Is there something wrong in the code? int32_t engine_handle_input(struct android_app* app, AInputEvent* event) { int etype = AInputEvent_getType(event); switch (etype) { case AINPUT_EVENT_TYPE_KEY: break; case AINPUT_EVENT_TYPE_MOTION: int32_t action,pointer_index; action = AMotionEvent_getAction(event); pointer_index = (action&AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; int32_t x1 = 0,x2; int32_t ..

Read more

Android studio build unity il2cpp project export such error, I change android studio -Xmx to 4g, but it does nothing help. Any idea? Task :unityLibrary:BuildIl2CppTask WARNING: NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please delete ndk.dir from local.properties and set android.ndkVersion to [21.3.6528147] ..

Read more

char szPath[64]; sprintf(szPath, "/proc/%d/mem", getpid()); int mem_fd = inotify_add_watch(fd, szPath, IN_ALL_EVENTS); log_error("%s: path=%s fd=%d, errno=%d", __FUNCTION__, szPath, mem_fd, errno); file access list: result: Thread_WatchProcMemery: path=/proc/32388/mem fd=-1, errno=13 When I set the debuggable=true of the APK package, the above problem does not exist! So what’s the problem? Source: Windows Que..

Read more

I’m new to JNI development. What I’m trying to achieve is that I need to capture a snapshot using JNI. I’m able to achieve the same using Kotlin/Java. I’m using the following code to capture the snapshot and copy it into a bitmap. jclass bitmapConfig = env->FindClass("android/graphics/Bitmap$Config"); jfieldID rgba8888FieldID = env->GetStaticFieldID(bitmapConfig, "ARGB_8888", "Landroid/graphics/Bitmap$Config;"); jobject rgba8888Obj ..

Read more

First I’ll clarify my environment: Windows 10, Visual Studio 2017. I’m trying to follow this tutorial: https://devblogs.microsoft.com/cppblog/build-your-android-applications-in-visual-studio-using-gradle/ All that being said, I’m trying to build an Android app that includes a library in the same solution: I have a red arrow pointing something suspicious about the reference of AndroidLib added to my AndroidApp. My C++ ..

Read more

I’ve tried to build libsndfile library for android using cmake. And after I included the library into my project it started to show me this error: libsndfile.a(sndfile.c.o) is incompatible with aarch64linux I use this command to build the library cmake -DCMAKE_TOOLCHAIN_FILE=/Users/semyon/Library/Android/sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake -DANDROID_NDK=/Users/semyon/Library/Android/sdk/ndk/23.1.7779620 -DANDROID_ABI="arm64-v8a" And include the library this way: target_link_libraries(Logic ${CMAKE_SOURCE_DIR}/logic/libs/android/libSoundTouch.a … ) Source: Windows ..

Read more

Problem I’m trying to NDK build simple tflite example code. When I build, this error is occured. error: undefined reference to ‘tflite::InterpreterBuilder::operator()(std::__1::unique_ptr<tflite::Interpreter, std::__1::default_delete<tflite::Interpreter> >*)’ My workflow First, I build tflite. I type command bazel build –config=elinux_aarch64 -c opt //tensorflow/lite:libtensorflowlite.so and libtensorflow.so file is created. And Secondely, I prepare tflite code. // Load model std::unique_ptr<tflite::FlatBufferModel> model ..

Read more