[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] How to call JNI Method in Linphone library

From: Amine Ghabi
Subject: Re: [Linphone-developers] How to call JNI Method in Linphone library
Date: Wed, 31 May 2017 17:12:22 +0200

Thanks for your reply but i have always this problem,I do not know the arguments that I will pass to the jobject obj not the second  jobject result !!! here is the code 

LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator) {
if (creator->service->create_account_request_cb == NULL
|| creator->cbs->create_account_response_cb == NULL) {
return LinphoneAccountCreatorStatusMissingCallbacks;

JNIEnv *env = ms_get_jni_env();
jstring jstr = env->NewStringUTF(env, "CSR");
jclass clazz = env->FindClass(env, packageName2);
jmethodID generateMthCSR = env->GetMethodID(env, clazz, myMethodName, "(Ljava/lang/String;)Ljava/lang/String;");
//ici c'est quoi les arguments que je dois passer au jobject ??
jobject obj=env->NewObject(clazz, generateMthCSR, ...);
jobject result = env->CallObjectMethod(env, obj, generateMthCSR, jstr);
const char* str = env->GetStringUTFChars(env,(jstring) result, NULL); // should be released
//printf("%s\n", str);
//return (*env)->NewStringUTF(env, str);

// kludge ercom
char *csr = env->NewStringUTF(env, str);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]