Do not set android:hardwareAccelerated="false". Disabling hardware acceleration will result in failure to render remote users' videos.
Step 3. Set obfuscation rules
In the proguard-rules.pro file, add the classes related to the TRTC SDK to the "do not obfuscate" list:
-keep class com.tencent.**{*;}
Using SDK Through C++ APIs (Optional)
If you prefer to use C++ APIs instead of Java for development, you can perform this step. If you only use Java to call the TRTC SDK, skip this step.
1. First, you need to integrate the TRTC SDK by importing JAR and SO libraries as instructed above.
2. Copy the C++ header file in the SDK to the project (path: SDK/LiteAVSDK_TRTC_xxx/libs/include) and configure the include folder path and dynamic link to the SO library in CMakeLists.txt.
cmake_minimum_required(VERSION 3.6)
# Configure the C++ API header file path
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include # Copied from `SDK/LiteAVSDK_TRTC_xxx/libs/include`
)
add_library(
native-lib
SHARED
native-lib.cpp)
# Configure the path of the `libliteavsdk.so` dynamic library
3. Use the namespace: The methods and types of cross-platform C++ APIs are all defined in the trtc namespace. To simplify your code, we recommend you use the trtc namespace.