Convert Figma logo to code with AI

DrKLO logoTelegram

Telegram for Android source

24,740
7,975
24,740
394

Top Related Projects

25,848

Telegram Desktop messaging app

Telegram web application, GPL v3

Telegram-iOS

6,953

Cross-platform library for building Telegram clients

Pure Python 3 MTProto API Telegram client library, for bots too!

Quick Overview

The DrKLO/Telegram repository is the official GitHub repository for the Telegram messaging app for Android. It contains the source code for the Android client, allowing developers to explore, contribute, and build custom versions of the Telegram app.

Pros

  • Open-source, allowing for transparency and community contributions
  • Regularly updated with new features and security improvements
  • Provides a foundation for developers to create custom Telegram clients
  • Serves as a learning resource for Android app development

Cons

  • Large codebase can be overwhelming for new contributors
  • Requires adherence to Telegram's API terms of service
  • May have licensing restrictions for commercial use
  • Limited documentation for certain parts of the codebase

Code Examples

This repository is not a code library but rather a full application source code. Therefore, code examples are not applicable in the traditional sense. However, developers can explore the source code to understand how various features are implemented.

Getting Started

As this is not a code library, there isn't a traditional "getting started" section. However, for developers interested in building the Telegram Android app from source, they can follow these general steps:

  1. Clone the repository:

    git clone https://github.com/DrKLO/Telegram.git
    
  2. Open the project in Android Studio.

  3. Set up the necessary SDK versions and build tools as specified in the project's build.gradle files.

  4. Build and run the app on an Android device or emulator.

Note: Developers should carefully review Telegram's terms of service and licensing requirements before using or modifying the code for their own purposes.

Competitor Comparisons

25,848

Telegram Desktop messaging app

Pros of tdesktop

  • Official desktop client developed by Telegram team
  • Cross-platform support (Windows, macOS, Linux)
  • More frequent updates and feature parity with mobile apps

Cons of tdesktop

  • Larger codebase, potentially more complex to contribute to
  • May have higher system requirements due to Qt framework

Code Comparison

tdesktop (C++):

void MainWindow::showSettings() {
    if (_settings) {
        _settings->showSettings();
    }
}

Telegram (Java):

public void showSettings() {
    presentFragment(new SettingsActivity());
}

Additional Notes

  • Telegram is primarily focused on Android, while tdesktop covers desktop platforms
  • tdesktop uses C++ with Qt framework, Telegram uses Java for Android
  • Both are open-source, allowing community contributions
  • Telegram (Android) may have better integration with mobile-specific features
  • tdesktop offers a native desktop experience with better performance on computers

Overall, the choice between these repositories depends on the target platform and development preferences. tdesktop is ideal for desktop applications, while Telegram is better suited for Android development.

Telegram web application, GPL v3

Pros of Webogram

  • Web-based client, accessible from any browser without installation
  • Lightweight and faster to load compared to native apps
  • Easier to contribute to and modify due to web technologies

Cons of Webogram

  • Limited access to device features (e.g., camera, contacts)
  • May have slower performance for resource-intensive tasks
  • Less secure than native apps due to browser vulnerabilities

Code Comparison

Webogram (JavaScript):

AppMessagesManager.sendText = function (peerString, text, options) {
  if (!angular.isString(text) || !text.length) {
    return $q.reject({type: 'NO_TEXT'});
  }
  options = options || {};
  var messageID = tempID--;

Telegram (Java):

public void sendMessage(TLRPC.User user, String message, MessageObject replyToMsg) {
    if (user == null || TextUtils.isEmpty(message)) {
        return;
    }
    TLRPC.TL_message newMsg = new TLRPC.TL_message();
    newMsg.message = message;

Both repositories implement message sending functionality, but Webogram uses JavaScript and Angular, while Telegram uses Java. Webogram's implementation is more web-oriented, while Telegram's is native Android-focused.

Telegram-iOS

Pros of Telegram-iOS

  • Native iOS development using Swift, providing better performance and integration with iOS features
  • More frequent updates and active development from the official Telegram team
  • Comprehensive documentation and contribution guidelines for developers

Cons of Telegram-iOS

  • Limited to iOS platform, reducing cross-platform compatibility
  • Larger codebase and potentially steeper learning curve for new contributors
  • Stricter adherence to Apple's guidelines, which may limit some features

Code Comparison

Telegram (Android):

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

Telegram-iOS:

class MainViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white
    }
}

The code snippets demonstrate the basic structure of a main view controller in both projects. Telegram uses Java for Android development, while Telegram-iOS utilizes Swift for native iOS development. The iOS version showcases Swift's concise syntax and iOS-specific conventions, highlighting the platform-specific nature of the repository.

6,953

Cross-platform library for building Telegram clients

Pros of td

  • More comprehensive and flexible API for Telegram functionality
  • Better performance and lower resource usage
  • Supports multiple programming languages through bindings

Cons of td

  • Steeper learning curve due to more complex architecture
  • Less user-friendly for simple applications
  • Requires more setup and configuration

Code Comparison

td:

auto client = td::Client::create();
auto query = td_api::make_object<td_api::getChats>();
client->send({1, std::move(query)});

Telegram:

TelegramClient client = new TelegramClient(apiId, apiHash, sessionFile);
client.connect();
List<Dialog> dialogs = client.getDialogs();

Key Differences

  • td is a lower-level library focusing on core Telegram functionality
  • Telegram is a full-featured Android app with a more user-friendly API
  • td offers more control and customization options
  • Telegram provides a simpler implementation for basic use cases

Use Cases

  • td: Ideal for complex Telegram-based applications or integrations
  • Telegram: Better suited for quick prototyping or simple Telegram clients

Community and Support

  • td: Larger developer community, more frequent updates
  • Telegram: Smaller community, but easier to get started with

Pure Python 3 MTProto API Telegram client library, for bots too!

Pros of Telethon

  • Written in Python, making it more accessible for rapid development and scripting
  • Comprehensive documentation and examples for easier implementation
  • Supports both user and bot accounts, offering more flexibility

Cons of Telethon

  • Limited to Python ecosystem, whereas Telegram is a native Android app
  • May have slower performance compared to native implementations
  • Requires more setup and configuration for basic functionality

Code Comparison

Telethon (Python):

from telethon import TelegramClient, events

client = TelegramClient('session', api_id, api_hash)

@client.on(events.NewMessage(pattern='/start'))
async def start_handler(event):
    await event.reply('Hello!')

client.start()
client.run_until_disconnected()

Telegram (Java):

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

The code snippets highlight the difference in approach: Telethon focuses on event-driven programming for Telegram interactions, while the Telegram repository contains Android-specific code for the mobile app interface.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Telegram messenger for Android

Telegram is a messaging app with a focus on speed and security. It’s superfast, simple and free. This repo contains the official source code for Telegram App for Android.

Creating your Telegram Application

We welcome all developers to use our API and source code to create applications on our platform. There are several things we require from all developers for the moment.

  1. Obtain your own api_id for your application.
  2. Please do not use the name Telegram for your app — or make sure your users understand that it is unofficial.
  3. Kindly do not use our standard logo (white paper plane in a blue circle) as your app's logo.
  4. Please study our security guidelines and take good care of your users' data and privacy.
  5. Please remember to publish your code too in order to comply with the licences.

API, Protocol documentation

Telegram API manuals: https://core.telegram.org/api

MTproto protocol manuals: https://core.telegram.org/mtproto

Compilation Guide

Note: In order to support reproducible builds, this repo contains dummy release.keystore, google-services.json and filled variables inside BuildVars.java. Before publishing your own APKs please make sure to replace all these files with your own.

You will require Android Studio 3.4, Android NDK rev. 20 and Android SDK 8.1

  1. Download the Telegram source code from https://github.com/DrKLO/Telegram ( git clone https://github.com/DrKLO/Telegram.git )
  2. Copy your release.keystore into TMessagesProj/config
  3. Fill out RELEASE_KEY_PASSWORD, RELEASE_KEY_ALIAS, RELEASE_STORE_PASSWORD in gradle.properties to access your release.keystore
  4. Go to https://console.firebase.google.com/, create two android apps with application IDs org.telegram.messenger and org.telegram.messenger.beta, turn on firebase messaging and download google-services.json, which should be copied to the same folder as TMessagesProj.
  5. Open the project in the Studio (note that it should be opened, NOT imported).
  6. Fill out values in TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java – there’s a link for each of the variables showing where and which data to obtain.
  7. You are ready to compile Telegram.

Localization

We moved all translations to https://translations.telegram.org/en/android/. Please use it.