Beispiel #1
0
        // JVM load the .so and calls this native function
        static jstring Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_stringFromJNI(
            ref JNIEnv env,
            jobject thiz)
        {
            log.__android_log_print(
                log.android_LogPriority.ANDROID_LOG_INFO, "xNativeActivity", "enter Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_stringFromJNI"
                );

            var n = env.NewStringUTF;

            // look almost the same file!

            var x = OvrApp.cxxGetString();

            //var v = n(ref env, "from Java_TestHybridOVR_OVRJVM_ApplicationActivity_stringFromJNI");
            var v = n(ref env, x);

            return(v);
        }
Beispiel #2
0
        // JVM load the .so and calls this native function
        static jlong Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_nativeSetAppInterface(
            ref JNIEnv env,
            jclass clazz,
            jobject activity,

            jstring fromPackageNameString, jstring commandString, jstring uriString
            )
        {
            log.__android_log_print(log.android_LogPriority.ANDROID_LOG_INFO, "xNativeActivity", "enter Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_nativeSetAppInterface");

            //jni/HybridOculusVrActivity.dll.c: In function 'Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_nativeSetAppInterface':
            //jni/HybridOculusVrActivity.dll.c:64:5: error: format not a string literal and no format arguments [-Werror=format-security]

            //android_native_app_glue.app_dummy();
            //var x = OvrApp.cxxGetString();

            //android_native_app_glue.app_dummy();
            //log.__android_log_print(log.android_LogPriority.ANDROID_LOG_INFO, "xNativeActivity", x);

            //      return (new OvrApp())->SetActivity( jni, clazz, activity );


            //I/System.Console(13696): enter  HybridOculusVrActivity.OVRJVM ApplicationActivity onCreate
            //I/xNativeActivity(13696): enter Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_stringFromJNI
            //I/xNativeActivity(13696): enter Java_HybridOculusVrActivity_OVRJVM_ApplicationActivity_nativeSetAppInterface

            // http://stackoverflow.com/questions/7281441/elegantly-call-c-from-c

            //long u = 0;

            return(OvrApp.cxxSetAppInterface(
                       ref env,
                       clazz,
                       activity,


                       // added by oculus050
                       fromPackageNameString, commandString, uriString
                       ));
        }