TD Light Java docs - OTR/Kotlin-Telegram-Client GitHub Wiki

Library description

Original documentation

TD Light Java Github Repository

TD Light Java generated Java Doc's

https://tdlight-team.github.io/tdlight-docs/tdlight.api/module-summary.html

Official Telegram TD Lib documentation

How to use TD Light Java in your Kotlin/Java project?

1. Add a custom Maven repository to the repositories block in your build.gradle file:

Kotlin DSL for Gradle:

repositories {
    mavenCentral()
    // ...
    maven { url = URI("https://mvn.mchv.eu/repository/mchv/") }
    // ...
}

2. Visit custom repository's Web Interface located on TD Light maven repository

2.1. Navigate through Index tree until you've reached path mchv/it/tdlight/tdlight-java-bom or visit the direct link Td Light Java BOM Artifact

2.2. Copy suggested artifact name from the input area on the right, which looks like:

Kotlin DSL for Gradle:

implementation("it.tdlight:tdlight-java-bom:2.8.10.6-ssl3")

Or download XML POM file to your local machine by clicking on certain artifact name (e.g. 2.8.10.6) from the list box on the left, which would lead you to the URL such as:

https://mvn.mchv.eu/mchv/it/tdlight/tdlight-java-bom/2.8.10.6/tdlight-java-bom-2.8.10.6.pom

3. Add this BOM artifact to your build:

Add the following dependencies to your build.gradle app level file:

General use:

TODO()

For Linux development envifonment:

dependencies {
    // ...
    implementation(platform("it.tdlight:tdlight-java-bom:2.8.10.6"))
    implementation("it.tdlight:tdlight-java")
    implementation("it.tdlight:tdlight-natives-linux-amd64")
    // ...
}

For Windows development environment:

dependencies {
    // ...
    implementation(platform("it.tdlight:tdlight-java-bom:2.8.10.6"))
    implementation("it.tdlight:tdlight-java")
    implementation("it.tdlight:tdlight-natives-windows-amd64")
    // ...
}

For Mac OS development environment:

dependencies {
    // ...
    implementation(platform("it.tdlight:tdlight-java-bom:2.8.10.6"))
    implementation("it.tdlight:tdlight-java")
    implementation("it.tdlight:tdlight-natives-windows-amd64")
    // ...
}

Sometimes API of TDLight changes and they delete old packages from their repository, in order to be able to launch a working example of use of TD Light Java I found on github, I needed to adjust virsions of dependencies by literally bruteforcing version's numbers. That example was written 8 months ago, and used old TD Light API which is removed from current version of the TD Light Java library. But I could not link old versions of libraries either, because they were removed from custom maven repository.

So after some time this is what worked out for my Windows development environment:

Kotlin DSL for Gradle:

dependencies {
    // ...
    implementation("it.tdlight:tdlight-java:2.8.5.7")
    implementation("it.tdlight:tdlight-natives-windows-amd64:4.0.274")
    // ...
}