I have class in C++ which must response for HTTP connection, that class must establish connection, send responses and do some other functions. This class is a part of huge project which I compile and finally get .so library for Android.
class HTTPSClient
{
public:
WinHTTPSClient();
~WinHTTPSClient();
bool Connect(const XMLString& a_strURL);
};
Now I want to call java functions from Connect function in c++. I have experiences in calling java functions from C++ code, but I always pass JavaVM to the class for example I call init(JavaVM* javaVm); and give as an argument javavm which comes from native code.
Now my question is: Can I call java method from C++ code without passing as an argument any JavaVm.
Define the JavaVM as a global/static variable of some class, e.g., by wrapping it up as a singleton. The variable can be accessed without explicitly passing it as an argument.