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
0
votes
1 answer

Implementing onActivityResult in a nonActivity Java Class

I am working on to capture image function through Intent call. I have been successful in implementing startActivityforResult from non-Activity class. I am getting activity Context there. Now, I want to receive onActivityResult in same java class. As…
NovusMobile
  • 1,813
  • 2
  • 21
  • 48
0
votes
0 answers

NDK NativeAvtivity reading/writing .txt file

How to read/write a txt file, without using Context to get Dir. Are there any "hardcoded" universal path. /data/data/com.project.name/file.mp3 ( .mp3 -protecting from compression) not working (crash with memory fault). Is it possible at all to using…
0
votes
2 answers

Unable to load native library on 4.2 4.3 but loads on recent versions

I've a native android app (NativeActivity, no java code but only libMyApp.so native library) The app runs perfectly on Android 5.0.1 and 5.1.1 but crashes on android 4.3 and 4.2.2 For 5.0.1 and 5.1.1 versions load the .so lib successfully from…
deimus
  • 9,565
  • 12
  • 63
  • 107
0
votes
1 answer

Nothing is drawn when using gles 2.0\egl\native activity on Android

Basically I have a very simple shader drawing a very primitive square on GLES 2.0, the shaders compile and load correctly, and I'm having no glErrors. I can get the glClearColor to display by using glClear, but nothing else is drawn. I've linked…
Viktor Sehr
  • 12,825
  • 5
  • 58
  • 90
0
votes
1 answer

NativeActivity override onKeyDown()

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…
pedr0
  • 2,941
  • 6
  • 32
  • 46
0
votes
2 answers

Native application with java class. Can't call native code from java

I want to call native code from java in case of native activity. Suppose I have game engine in engine.so. Now I want to add speech recognition. I added java wrapper-class and start speech recognition from native code via jni. I want to return result…
0
votes
1 answer

Showing an Android PopupWindow over a NativeActivity

I'm trying to implement AdMob in my Android game which has been ported using the NDK, and SDL. I've been following the example here, but when I call showAdPopup, my game's Activity seems to be destroyed, I'm left with a blank grey screen, with an ad…
Kazade
  • 1,297
  • 2
  • 15
  • 25
0
votes
2 answers

Remove a contentView from NativeActivity

What is the correct (or any) way to remove a view that has been set using setContentView. The application is basically a NativeActivity application that uses openGL and as such has no layouts/views defined. I needed to add a splash screen very…
Adrian Brown
  • 456
  • 3
  • 14
0
votes
1 answer

Another Unsatisfied Linker Error. Cannot find 'main'

I have tried to create an Android Native Activity by following the many guides out there, but I cannot get my application to run. Instead, I am presented with the following from LogCat: 05-15 07:39:21.337 I/ActivityManager( 857): START u0…
David Brown
  • 522
  • 2
  • 12
0
votes
1 answer

What determines the length of (un)blankDisplay in Android Native Activity?

Currently I'm getting the following output in Logcat: Excessive delay in unblankDisplay() while turning screen on: 237ms This seems to trigger the OS destroying my window and attempting to recreate it, but my frame time doesn't seem to be anywhere…
0
votes
0 answers

NativeActivity: cannot locate symbol "_ZSt11_Hash_bytesPKvjj"

I'm trying to compile an application using C++11 and OpenGL ES for Android using NativeActivity. I'm using APP_STL := gnustl_shared and everything compiles just fine. But when running my app I get: dlopen(libjngl-test.so): Cannot load library:…
jhasse
  • 2,379
  • 1
  • 30
  • 40
0
votes
1 answer

How to debug heap in a Native Activity on Android?

Is there a way to debug the heap in C++ in a Native Activity for overrun/underrun errors? There is zero Java usage in my application. Something I know about is the MALLOC_CHECK_ which doesn't seem to be applicable to GNU libstdc++. I'm looking for…
Mike Weir
  • 3,094
  • 1
  • 30
  • 46
0
votes
1 answer

NativeActivity spawn standard Activity problems

I have a NativeActivity app that i ideally want to display a standard GUI layout over the top of at one point. Ive looked around alot and tried various things that people have suggested but cant seem to get anything to work. The main reponse ive…
Adrian Brown
  • 456
  • 3
  • 14
0
votes
1 answer

Failure to get ref to NativeActivity subclass from C++

I'm writing a native app with a Java class derived from NativeActivity. I need to get a reference to that class in my C++ code, but when I try to do that in code called from ANativeActivity_onCreate the class can't be found. My code looks something…
realh
  • 962
  • 2
  • 7
  • 22
0
votes
1 answer

Android MediaPlayer Doesn't Display Video on Scroll Plus 7 device when Native App calls eglSwapBuffers

I've an app that uses a Native Activity as it is mostly C++ code (cross platform). I also need to play Video and Audio so have another Activity that uses MediaPlayer to play video and/or audio. This is used in conjunction with the Native Activity to…
1 2 3
8
9