Skip to content

Add library to your project

Pedro Sánchez edited this page Mar 13, 2024 · 93 revisions

Getting started

Permissions

This library require this permissions in your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--Optional for play store-->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

Remember that you need get runtime permissions in Android API 23+.

Compile

Gradle

Add this to your build.gradle:

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  implementation 'com.github.pedroSG94.RootEncoder:library:2.4.3'
}

If you want check other version you can see all versions in my jitpack

Manual

Download the project:

git clone https://github.com/pedroSG94/RootEncoder.git

Import modules library, encoder, rtmp, rtsp, srt, common and udp to your project (In Android Studio you can find import module option in File -> New -> Import Module...).

Add this lines in to root build file in the project.

Groovy DSL
buildscript {
    ext.libraryGroup = "com.github.pedroSG94"
    ext.vCode = 243
    ext.vName = "2.4.3"
    ext.coroutinesVersion = "1.7.3"
    ext.junitVersion = "4.13.2"
    ext.mockitoVersion = "5.2.1"
}
Kotlin DSL
val libraryGroup by rootProject.extra { "com.github.pedroSG94" }
val vCode by rootProject.extra { 243 }
val vName by rootProject.extra { "2.4.3" }
val coroutinesVersion by rootProject.extra { "1.7.3" }
val junitVersion by rootProject.extra { "4.13.2" }
val mockitoVersion by rootProject.extra { "5.2.1" }

Open all .kts files in each module (library, encoder, common, rtmp, rtsp, srt and udp) and remove the following lines:

id("maven-publish")
id("org.jetbrains.dokka")



publishing {
    singleVariant("release")
}

afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            create<MavenPublication>("release") {
                // Applies the component for the release build variant.
                from(components["release"])

                // You can then customize attributes of the publication as shown below.
                groupId = libraryGroup
                artifactId = "srt"
                version = vName
            }
        }
    }
}

Add library module to your app build file:

Groovy DSL
dependencies {
  implementation project(':library')
}
Kotlin DSL
implementation(project(":library"))