3. Getting Started
To understand how to import SDK, and test your development enviornment.
- Recommended using Android Studio(2021.1.1Patch1; 2020.3.1Patch4),ndk21.4.7075529 to develop.
- Open the project 'NativeSDK\Samples\QiyuVR_NativeActivity',at Build -> Rebuild Project.
Note
Please setting "android:extractNativeLibs = true" in 'AndroidManifest.xml'.
The default value android:extractNativeLibs in different version:
a. When minSdkVersion < 23 or Android Gradle plugin < 3.6.0, the default value of android:extractNativeLibs is true.
b. When minSdkVersion >= 23 and Android Gradle plugin >= 3.6.0, the default value of android:extractNativeLibs is false, which should be changed to true.
System.loadLibrary
Recommended: We suggest that package the System.loadLibrary into public class NDKHelper
You can load the library by using ndk_helper::JNIHelper::GetInstance()->Init(app->activity, HELPER_CLASS_NAME, "qiyuapi");
in void android_main(struct android_app* app)
Please refer to the sample code at github\android\ndk-samples\teapots, https://github.com/android/ndk-samples.git .
Not recommended: We do not recommend that loading the library by using the static { System.loadLibrary("qiyuapi"); }
directly in public class MainActivity extends android.app.NativeActivity