A Java Wrapper for TDLib/TDLight
Go to file
Andrea Cavalli 0e2d613186 Update README.md 2020-08-20 13:46:17 +02:00
common-utils@8da67564c5 Update common-utils and pom.xml 2020-08-16 22:59:02 +02:00
src/main Renamed tdnatives to tdlib 2020-08-20 01:59:56 +02:00
.gitignore Update .gitignore 2020-05-18 22:17:57 +02:00
.gitmodules Update .gitmodules 2020-08-19 01:02:05 +02:00
JTDLIB_LICENSE Rewrite ReadMe 2020-08-20 12:18:04 +02:00
LICENSE Added missing license 2018-11-20 18:51:11 +01:00
README.md Update README.md 2020-08-20 13:46:17 +02:00
jitpack.yml Updated jitpack.xml 2020-08-06 12:13:31 +02:00
pom.xml Update to version 3.168.0 2020-08-20 11:35:57 +02:00

README.md

TDLight Java Build Status

A barebone java wrapper for TDLib (and TDLight)

This wrapper gives you direct access to TDLib API in Java.

Requirements

JVM: Oracle JVM and OpenJDK

Java versions: Java 10, 11, 12, 13, 14

Operating system: Windows, Linux

Supported CPU architectures: amd64 (linux, windows), aarch64 (linux)

Required libraries for linux: OpenSSL and zlib

Including TDLight in a project

Maven configuration example to use this version of tdlight-java:

<repositories>
  <repository>
    <id>tdlight-gihtub</id>
    <name>GitHub TDLight Team Apache Maven Packages</name>
    <url>https://maven.pkg.github.com/tdlight-team/tdlight-java</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>it.tdlight</groupId>
    <artifactId>tdlight-java</artifactId>
    <version>REPLACE_WITH_LATEST_VERSION</version>
  </dependency>
</dependencies>

Gradle configuration example to use this version of tdlight-java:

repositories {
     maven { url "https://maven.pkg.github.com/tdlight-team/tdlight-java" }
}
dependencies {
     implementation 'it.tdlight:tdlight-java:REPLACE_WITH_LATEST_VERSION'
}

Replace REPLACE_WITH_LATEST_VERSION with the latest version of tdlight, you can find it on the Releases tab on github.

Usage

Simple initialization of a native TDLib client

import java.io.File;

import it.tdlight.tdlight.Client;
import it.tdlight.tdlight.Init;
import it.tdlight.tdlight.Log;

public class Example {
    public static void main(String[] args) {
        // Initialize TDLight native libraries
        Init.start();

        // Set TDLib log level to 1
        Log.setVerbosityLevel(1);

        // Uncomment this line to print TDLib logs to a file
        // Log.setFilePath("logs" + File.separatorChar + "tdlib.log");
        
        Client client = new Client();
        
        // Initialize the TDLib client
        client.initializeClient();

        // Now you can use the client
    }
}

TDLib methods documentation

TdApi class javadoc

About

License

TDLight is licensed by Andrea Cavalli andrea@cavallium.it under the terms of the GNU Lesser General Public License 3

Libraries licenses

JTDlib is licensed by Ernesto Castellotti erny.castell@gmail.com under the terms of the GNU Lesser General Public License 3

TDLib is licensed by Aliaksei Levin levlam@telegram.org and Arseny Smirnov arseny30@gmail.com under the terms of the Boost Software License

OpenSSL is licensed under the terms of Apache License v2

Zlib is licensed under the terms of Zlib license