Questions tagged [native-activity]

NativeActivity is a convenience class provided by the Android SDK that notifies native code of any activity lifecycle callbacks and makes it possible to write Android application without any Java code at all.

The Android SDK provides the NativeActivity class, which is a convenience class that notifies your native code of any activity lifecycle callbacks (onCreate(), onPause(), onResume(), etc). You can implement the callbacks in your native code to handle these events when they occur. Applications that use native activities must be run on Android 2.3 (API Level 9) or later. You cannot access features such as Services and Content Providers natively, so if you want to use them or any other framework API, you can still write JNI code to do so.

http://developer.android.com/sdk/ndk/overview.html

http://developer.android.com/reference/android/app/NativeActivity.html

132 questions
1
vote
2 answers

Error launching Android NDK app

I've written a NativeActivity that's crashing on launch because (my theory...) I'm doing something wrong naming the shared library or the module or something in AndroidManifest.xml. Below is the output of LogCat when my app is launched, along with…
ALF
  • 11
  • 1
  • 2
1
vote
1 answer

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

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…
no name
  • 51
  • 6
1
vote
0 answers

orientation changes in a NativeActivity

I have got a problem handling orientation changes from a nativeactivity for my opengl related app. I have the JNI setup for two functions: - One for setting the orientation and - One for getting what the orientation currently is. I am using the…
cyb3rcolby
  • 53
  • 7
1
vote
0 answers

Why are Workflow Exceptions are not caught when thrown from Cancel?

I am using Microsoft Windows Workflow Foundation in my Windows based application. I have subscribed to OnUnhandledException on workflow for any unexpected exception. The OnHandledException callback is received for all exceptions inside workflow but…
1
vote
0 answers

NDK android_app gets APP_CMD_INIT_WINDOW without a window?

My NDK-based Android App is using android_native_glue.c that defines the android_app structure. Member of this structure is android_app.window and the source-code comments have this to said about it: // When non-NULL, this is the window surface that…
Bram
  • 7,440
  • 3
  • 52
  • 94
1
vote
1 answer

how to interact Vulkan with Android Java Activity

Currently, android Vulkan only supports NativeActivity, but is there any way we can use Java Activity and SurfaceView or any other view and pass Native through JNI to get NativeWindow handler. I tried looking around and link my surface view but it…
Hemant
  • 61
  • 5
1
vote
0 answers

Handle inputs in NativeActivity

I have a Native Activity android project with Android studio, I added the ANativeActivity_onCreate. now I wanna handle inputs, I found callbacks in the activity pointer but I can't find a good tutorial to know how to handle them. In Eclipse there is…
1
vote
1 answer

App crashes on eglSwapBuffers

I am trying to fill the screen by red color in my native activity but it crashes on eglSwapBuffers with 07-19 10:36:40.497 3197-3232/com.contedevel.davinci A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xf4169e90 in tid 3232…
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
1
vote
1 answer

Android Native Activity - Call Java method

I've been trying for a while to call a java method from c++, I am able to do it successfully with an Activity class but with a NativeActivity, it crashes when calling CallVoidMethod. GetMethodID is able to find it, it returns an address. env & vm…
Skrakle
  • 79
  • 1
  • 1
  • 9
1
vote
2 answers

Android NativeActivity and ARCore C lib: function "ArSession_create()" fails when called in a NativeActivity

I'm trying to create AR session by ARCore C library inside a NativeActivity. However, the function "ArSession_create()" always returns error code AR_ERROR_FATAL (-2), but there is no crash expcet that the AR session is not created. The following is…
Hongkun Wang
  • 717
  • 8
  • 22
1
vote
1 answer

Android NativeActivity: AttachCurrentThread JNIInvokeInterface is not a structure or union

I am using the NativeActivity from C. My goal is to get a reference to a JNIEnv so I can make further Android calls. Going by the examples I have gathered on the Android documentation and Stackoverflow, I keep seeing…
1
vote
1 answer

GLES 2 Functions Not Working in Visual Studio

I'm using Visual Studio Community 2017, but the native-activity in this version is the same as in Visual Studio Community 2015. I have just created a new native activity project in Visual Studio 2017, using the default program that loads with this…
Cpp plus 1
  • 990
  • 8
  • 25
1
vote
2 answers

Native Activity, GLES2.0: Uploading pixel array to screen

I created a pixmap using, for example, this code //... // Native Activity #define HEIGHT 600 #define WIDTH 600 uint32_t texDat[WIDTH*HEIGHT*4]; static double it = 0; uint8_t color = sin(it)*256; for (int i = 0; i < WIDTH; i++) for (int j = 0; j <…
1
vote
2 answers

Can't open obb file although it is there

I'm trying to mount an obb file but std::fstream test("/storage/emulated/0/Android/obb/com.bixense.jngl_test/main.1.com.bixense.jngl_test.obb"); assert(test); says it doesn't exist (or I can't access it). When looking via adb shell the file is…
jhasse
  • 2,379
  • 1
  • 30
  • 40
1
vote
1 answer

Android NDK NativeActivity Memory Management Needed?

I'm using NativeActivty with native_app_glue to program an OpenGL game for Android. It is hard to determine when is the best time to delete heap allocated objects and objects allocated by OpenGL. In the NDK's NativeActivity sample they don't seem to…
Josh
  • 63
  • 6
1 2 3
8 9