I’m using the JNI methods to use the Android Media player in app. I get a crash when running the following code on Android 5.0 (Lollipop) but not Android 4.4 (KitKat):
Perhaps the Lollipop method has a different signature from the KitKat one? But I don’t see any separate docs for Lollipop. I’m new to Android development so just wondering if anyone knows what the issue might be or what the best forum would be to discuss it.
These APIs automatically match and build the JNI method signature according to the passed in parameters & return type, so it’s less error prone than trying to do it yourself.
Thanks for the info. I’m actually using sample code (part of the Oculus Mobile SDK) and I noticed this commented code right above the code I referenced earlier:
//Can’t use AndroidJavaObject.Call() with a jobject, must use low level interface //mediaPlayer.Call( “setSurface”, androidSurface );
Not sure what the reason for that is. Will look into it and post here if I find anything.
there are some limitations with the AndroidJavaObject API, but it should work in most cases. Perhaps the sample is old from a time where this didn’t work properly…