17 if (JNIEnv* Env = FAndroidApplication::GetJavaEnv())
19 jclass JavaClassClass = Env->FindClass(
"java/lang/Class");
20 jmethodID JavaGetClassNameMethod = Env->GetMethodID(JavaClassClass,
"getName",
"()Ljava/lang/String;");
21 jstring JavaActivityClassID = (jstring)Env->CallObjectMethod(FJavaWrapper::GameActivityClassID, JavaGetClassNameMethod);
22 const char* GameActivityClassName = Env->GetStringUTFChars(JavaActivityClassID, 0);
23 Log(
"Assigned Java functions for class %s", GameActivityClassName);
24 Env->ReleaseStringUTFChars(JavaActivityClassID, GameActivityClassName);
26 LaunchApplicationFunction = FJavaWrapper::FindMethod(Env, FJavaWrapper::GameActivityClassID,
"AndroidThunkJava_IsPackageInstalled",
"(Ljava/lang/String;)Z",
false);
27 IsApplicationInstalledFunction = FJavaWrapper::FindMethod(Env, FJavaWrapper::GameActivityClassID,
"AndroidThunkJava_LaunchPackage",
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z",
false);
36 if (JNIEnv* Env = FAndroidApplication::GetJavaEnv())
38 auto PackageNameArg = FJavaHelper::ToJavaString(Env, ApplicationName);
39 bResult = FJavaWrapper::CallBooleanMethod(Env, FJavaWrapper::GameActivityThis, FJavaWrapper::AndroidThunkJava_IsPackageInstalled, *PackageNameArg);
42 Log(
"UPPlatformSubsystem::IsApplicationInstalledFunction: %d", bResult);
51 if (JNIEnv* Env = FAndroidApplication::GetJavaEnv())
53 auto ApplicationNameArg = FJavaHelper::ToJavaString(Env, ApplicationName);
54 auto ExtraKeyArg = FJavaHelper::ToJavaString(Env, ExtraKey);
55 auto ExtraValueArg = FJavaHelper::ToJavaString(Env, ExtraValue);
56 bResult = FJavaWrapper::CallBooleanMethod(Env, FJavaWrapper::GameActivityThis, FJavaWrapper::AndroidThunkJava_LaunchPackage, *ApplicationNameArg, *ExtraKeyArg, *ExtraValueArg);
59 Log(
"UPPlatformSubsystem::LaunchApplication: %s, %s : %s", *ApplicationName, *ExtraKey, *ExtraValue);