Integrate SDK

1.1 Supported version

The SDK supports JDK 1.6 and Android SDK version 18 or higher.

1.2 Download the SDK

Download the SDK, and it is including:

libs
├── armeabi-v7a
│ ├── libstarRTC.so
│ └── libstarCore.so
└── star_rtc_sdk.jar

1.3 Creating an application

1.3.1 Importing SDK Files

创建一个新工程,将下载的库文件复制到工程的libs/文件夹下
然后在Moudle的gradle文件里添加如下代码。

android{

sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
implementation files('libs/star_rtc_sdk.jar')
}

1.3.2 Adding Related Permissions

Add the following permissions in the project’s AndroidManifest.xml:

   <uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

1.3.3 Turning on hardware acceleration

Be sure to set the value android:hardwareAccelerated to true in the AndroidManifest.xml file If the hardware acceleration is not turned on, the player cannot be created, and the video screen cannot be displayed.

1.3.4 Code Confusion Rules

Add the following code to the proguard-rules.pro file

-keep class com.starrtc.**{*;}
-dontwarn com.starrtc.**