native-activity

Crash when closing soft keyboard while using native activity

天涯浪子 提交于 2021-02-18 02:29:00
问题 We are developing an indie game for android and would like the user to choose his nickname. We have chosen to use the Native Activity that is provided by the NDK as that seemed to be the easiest way to go. The first problem we've encountered with the keyboard was that the function ANativeActivity_showSoftInput() seems to do nothing at all (as described e.g. here), so we bring up the keyboard using JNI calls to function: static void showKeyboard(Activity activity) { String s = Context.INPUT

Crash when closing soft keyboard while using native activity

旧巷老猫 提交于 2021-02-18 02:25:14
问题 We are developing an indie game for android and would like the user to choose his nickname. We have chosen to use the Native Activity that is provided by the NDK as that seemed to be the easiest way to go. The first problem we've encountered with the keyboard was that the function ANativeActivity_showSoftInput() seems to do nothing at all (as described e.g. here), so we bring up the keyboard using JNI calls to function: static void showKeyboard(Activity activity) { String s = Context.INPUT

I'm trying to draw objects using opengles in Android Native-activity, but I don't see anything

笑着哭i 提交于 2021-02-05 08:22:49
问题 I'm developing my game using opengles1.0 in Native Activity. However, source code, which used to work well, doesn't work. Nothing is drawing on the screen, but I want to know the cause. This is my source code. static int engine_init_display(struct engine* engine) { // initialize OpenGL ES and EGL /* * Here specify the attributes of the desired configuration. * Below, we select an EGLConfig with at least 8 bits per color * component compatible with on-screen windows */ const EGLint attribs[] =

Problem using OpenCV2.3.1 with Android Native Activity

对着背影说爱祢 提交于 2020-01-13 07:39:13
问题 i'm developing a computer vision application for Android. That work involves getting camera frames as fast as possible, so I'm trying to build a android application directly in c++ using "android_native_app_glue" and "libnative_camera" to get camera frames. It seems to be incompatible. I tested out 2 options. I tried to use OpenCV on the android NDK sample "NativeActivity", just make the few necessary changes (convert sample to c++, modify android.mk y application.mk and including using

java.lang.IllegalArgumentException: Unable to load native library

白昼怎懂夜的黑 提交于 2020-01-13 02:43:34
问题 I'm using purely native NDK in my project (Native Activity). It works fine when I add Prebuilt static libraries with my .so in Android.mk file. But when I try linking Prebuilt shared library, it shows the below exception: 03-27 16:42:09.982: E/AndroidRuntime(1275): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.irrlicht.example/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.irrlicht.example-1

Hiding the navigation bar in pure android native

蓝咒 提交于 2020-01-04 04:26:08
问题 I've seen articles and articles on hiding the navigation bar for android application through java. However, what I would like to know, is how do I remove the navigation bar through a pure android c++ native-activity application for a full-screen application(game)(NO JAVA AT ALL!) . Full-screen from the android manifest works at hiding the top bar, but the navigation bar stays visible. This is the Navigation Bar that I wish to remove. I've searched through books with no luck, there's is no

Checking if directory (folder) exists in apk via native code only

我的梦境 提交于 2020-01-02 10:23:39
问题 I need to check wether a certain directory exists in apk. The android/asset_manager.h api seems to be inconsistent - it returns NULL when AAsset* AAssetManager_open(AAssetManager* mgr, const char* filename, int mode); fails to open a file, but for directories AAssetDir* AAssetManager_openDir(AAssetManager* mgr, const char* dirName); 's implementation always returns a new AAssetDir(...) , even if internally it failed to open/find the directory in apk. It is quite irritating that AAssetDir is

NativeActivity override onKeyDown()

一世执手 提交于 2019-12-25 04:28:06
问题 I having problem with a NativeActivity subclass I am working on, my goal would be to catch and handle key events from the Java code instead of native code (this is mainly due because this), unfortunately I can not see the Log() present in the onKeyDown method though the onCreate() log is being printed and the log prints I have placed in the native code are as well. It seems that the onKeyDown of my NativeActivity subclass is never called. Any idea? public class CNativeActivity extends

“dlopen: Invalid argument” when loading native activity

最后都变了- 提交于 2019-12-25 02:46:48
问题 I'm using the following bootstrapping code to load my native activity (jngl-test): #include <android/native_activity.h> #include <android/log.h> #include <dlfcn.h> #include <errno.h> #include <stdexcept> const std::string LIB_PATH = "/data/data/com.bixense.jngl_test/lib/"; void* load_lib(const std::string& l) { void* handle = dlopen(l.c_str(), RTLD_NOW | RTLD_GLOBAL); if (!handle) { throw std::runtime_error(std::string("dlopen(") + l + "): " + strerror(errno)); } return handle; } void

How do I enable full screen immersive mode for a Native Activity NDK app?

拥有回忆 提交于 2019-12-22 17:06:07
问题 Reading the documentation at https://developer.android.com/training/system-ui/immersive.html I can't seem to find any information on how to set full screen immersive mode in a Native Activity NDK app (without using JNI) as it seems full screen immersive mode can only be toggled from Java. As it cannot be set from the manifest (Set Android immersive full screen mode in manifest), is there any way to request it via EGL? Seems the only way to enable full screen immersive mode is to call