(also in 4.10 and 4.11)
In AndroidJNI.h this is declared:
static jmethodID AndroidThunkJava_GetCurrentVolume;
But in AndroidJNI.cpp there is no reference to the variable at all.
I found a post here that did have that, which I thought made it into 4.10, yet it seems like it only partially made it into 4.10.
This is also nowhere to be found:
int32 AndroidThunkCpp_GetCurrentVolume()
Is this a bug?
Or am I supposed to retrieve the current volume in a different way?
It seems like there is code missing in AndroidJNI.cpp.
Could you double check if this is the case or not, and if not, could you let me know how the implementation should be used?
You’re doing it wrong;
Let’s start by taking a look at a recent PR of mine that adds some android functionality and underline some key points:https://github.com/EpicGames/UnrealEngine/pull/2497 (not yet merged).
Look into the changed files:
The method whose implementation at C++ side is missing should be located somewhere at Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java . If it’s not, the functionality is not there yet;
At Engine/Source/Runtime/Launch/Private/Android/AndroidJNI.h happens the declaration of the jmethodID
and at Engine/Source/Runtime/Launch/Private/Android/AndroidJNI.cpp happens the 1) In the constructor a search to initialize all the method IDs (FindMethod) and 2) Implementation of AndroidThunkCpp_* (calling AndroidThunkJava_* method via JNI) function.
That, in general is how a new integration of a simple new java function is added on the engine. You do not specify where you did write that code. Be sure to follow the steps I mentioned above, build the engine and test on a new project. It should work normally.
Maybe. Maybe there was another unknown reason that it’s still unimplemented.
FAndroidMisc::GetVolumeState() was implemented instead.
The answer from Chris:
FAndroidMisc::GetVolumeState() was implemented instead.