Obsolete Members for QJniEnvironment

QJniEnvironment 클래스의 다음 멤버들은 더 이상 사용되지 않습니다. 이 멤버들은 기존 소스 코드가 계속 작동하도록 하기 위해 제공됩니다. 새로운 코드에서는 이 멤버들을 사용하지 않는 것을 강력히 권장합니다.

공개 함수

(deprecated in 6.2) bool registerNativeMethods(const char *className, JNINativeMethod[] methods, int size)

멤버 함수 설명

[deprecated in 6.2] bool QJniEnvironment::registerNativeMethods(const char *className, JNINativeMethod[] methods, int size)

이 함수는 6.2 버전부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 const JNINativeMethod[]를 사용하는 오버로드를 사용하십시오.

배열 methods 에 포함된 Java 메서드(크기 size)를 등록하며, 각 메서드는 클래스 className 의 네이티브 C++ 함수를 호출할 수 있습니다. 이러한 메서드는 호출하기 전에 반드시 등록해야 합니다.

등록에 성공하면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

메서드 배열의 각 요소는 다음으로 구성됩니다:

  • Java 메서드 이름
  • 메서드 시그니처
  • 실행될 C++ 함수
JNINativeMethod methods[] = {{"callNativeOne", "(I)V", reinterpret_cast<void *>(fromJavaOne)},
                             {"callNativeTwo", "(I)V", reinterpret_cast<void *>(fromJavaTwo)}};
QJniEnvironment env;
env.registerNativeMethods("org/qtproject/android/TestJavaClass", methods, 2);

이것은 오버로드된 함수입니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.