• Stars
    star
    1,081
  • Rank 42,808 (Top 0.9 %)
  • Language
    Java
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Email-based instant messaging for Android.

Delta Chat Android Client

This is the Android client for Delta Chat. It is available on F-Droid and the Google Play Store. The APK can also be downloaded from GitHub (only for experienced users).

For the core library and other common info, please refer to the Delta Chat Core Library.

Screenshot Chat List Screenshot Chat View

Check Out Repository

When checking out deltachat-android, make sure also to check out the subproject deltachat-core-rust:

  • When using Git, you can do this initially by $ git clone --recursive https://github.com/deltachat/deltachat-android or later by git submodule update --init --recursive. If you do this in your home directory, this results in the folder ~/deltachat-android which is just fine.

Build Using Nix

The repository contains Nix development environment described in flake.nix file. If you don't have Nix installed, the easiest way is to use The Determinate Nix Installer which installs Nix with Flakes feature enabled out of the box and can be cleanly uninstalled with /nix/nix-installer uninstall once you don't need it anymore.

Once you have Nix with Flakes feature set up, run nix develop to start development environment shell.

Nix development environment contains Rust with cross-compilation toolchains and Android SDK. To build an APK, run:

$ scripts/ndk-make.sh
$ ./gradlew assembleDebug

Resulting APK files can be found in build/outputs/apk/gplay/debug/ and build/outputs/apk/fat/debug/.

Build Using Dockerfile

Another way to build APK is to use provided Dockerfile with Docker or Podman. Podman is a drop-in replacement for Docker that does not require root privileges.

If you don't have Docker or Podman setup yet, read how to setup Podman below. If you don't want to use Docker or Podman, read how to manually install the build environment.

First, build the image deltachat-android by running

podman build --build-arg UID=$(id -u) --build-arg GID=$(id -g) . -t deltachat-android

or

docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) . -t deltachat-android

Then, run the image:

podman run --userns=keep-id -it --name deltachat -v $(pwd):/home/app:z -w /home/app localhost/deltachat-android

or

docker run -it --name deltachat -v $(pwd):/home/app:z -w /home/app localhost/deltachat-android

You can leave the container with Ctrl+D or by typing exit and re-enter it with docker start -ia deltachat or podman start -ia deltachat.

Within the container, install toolchains and build the native library:

deltachat@6012dcb974fe:/home/app$ scripts/install-toolchains.sh
deltachat@6012dcb974fe:/home/app$ scripts/ndk-make.sh

Then, build an APK:

deltachat@6012dcb974fe:/home/app$ ./gradlew assembleDebug

Troubleshooting

  • Executing ./gradlew assembleDebug inside the container fails with The SDK directory '/home/user/Android/Sdk' does not exist.:

    The problem is that Android Studio (outside the container) automatically creates a file local.properties with a content like sdk.dir=/home/username/Android/Sdk, so, Gradle-inside-the-container looks for the Sdk at /home/username/Android/Sdk, where it can't find it. You could:

    • either: remove the file or just the line starting with sdk.dir
    • or: run ./gradlew assembleDebug from outside the container (however, there may be incompability issues if different versions are installed inside and outside the container)
  • Running the image fails with ERRO[0000] The storage 'driver' option must be set in /etc/containers/storage.conf, guarantee proper operation.:

    In /etc/containers/storage.conf, replace the line: driver = "" with: driver = "overlay". You can also set the driver option to something else, you just need to set it to something. Read about possible options here.

Setup Podman

These instructions were only tested on a Manjaro machine so far. If anything doesn't work, please open an issue.

First, Install Podman.

Then, if you want to run Podman without root, run:

sudo touch /etc/subgid
sudo touch /etc/subuid
sudo usermod --add-subuids 165536-231072 --add-subgids 165536-231072 yourusername

(replace yourusername with your username). See https://wiki.archlinux.org/index.php/Podman#Rootless_Podman for more information.

Install Build Environment (without Docker or Podman)

To setup build environment manually:

  • Either, in Android Studio, go to "Tools / SDK Manager / SDK Tools", enable "Show Package Details", select "CMake" and the desired NDK (install the same NDK version as the Dockerfile), hit "Apply".
  • Or read Dockerfile and mimic what it does.

Then, in both cases, install Rust using rustup and Rust toolchains for cross-compilation by executing scripts/install-toolchains.sh.

Then, configure ANDROID_NDK_ROOT environment variable to point to the Android NDK installation directory e.g. by adding this to your .bashrc:

export ANDROID_NDK_ROOT=${HOME}/Android/Sdk/ndk/[version] # (or wherever your NDK is) Note that there is no `/` at the end!
export PATH=${PATH}:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/:${ANDROID_NDK_ROOT}

After that, call scripts/ndk-make.sh in the root directory to build core-rust. Afterwards run the project in Android Studio. The project requires API 25.

With chance, that's it :) - if not, read on how to set up a proper development environment.

Install Development Environment

  1. Some libs required by Android Studio may be missing on 64 bit Linux machines Source], so for Ubuntu execute $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 and for Fedora execute $ sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686.

  2. Download Android Studio from https://developer.android.com (android-studio-ide-...-linux.zip) and unpack the archive which contains a single folder called android-studio; move this folder e.g. to ~/android-studio.

  3. To launch Android Studio for the first time, open a terminal, navigate to ~/android-studio/bin, execute ./studio.sh and use all the standard values from the wizard.

  4. Android Studio now asks you if you want to open an existing project; choose ~/deltachat-android as created in the "Build" chapter (Android Studio starts to build the project, however, there are some steps missing before this will succeed).

  5. If components are missing, click on the corresponding error message and install eg. required SDKs and the "Build-Tools" (you should also find the option at "Tools / Android / SDK Manager / SDK Platforms"). Now the build should succeed - but the app still misses the native part.

  6. Download Android NDK from NDK Archives and extract the archive containing a single folder called something like android-ndk-r23b-linux; move this folder e.g. to ~/android-ndk.

  7. Export the folder path to your environment as ANDROID_NDK_ROOT and add it to PATH. You can achieve this e.g. by adding this to your .bashrc

    export ANDROID_NDK_ROOT=${HOME}/android-ndk
    export PATH=${PATH}:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/:${ANDROID_NDK_ROOT}

Run UI Tests and Benchmarks

  • You don't necessarily need a dedicated testing device. Backup your current account first, maybe there are some bugs in switching accounts.

  • You can run benchmarks on either an emulated device or a real device. You need at least Android 9. For better benchmark results, you should run the benchmark on a real device and make sure that the core is compiled in release mode.

  • Disable animations on your device, otherwise the test may fail: at "Developer options" set all of "Window animation scale", "Transition animation scale" and "Animator duration scale" to 0x

  • In Android Studio: "File" / "Sync project with gradle files"

  • In Android Studio: "Run" / "Edit configurations" / "+" / "Android Instrumented test": Either select a specific class or select "All in Module" / "OK" / Select your configuration in the toolbar / Click on the green "run" button in the toolbar to run the tests

Get the benchmark results

When the benchmark is done, you will get a result like MEASURED RESULTS (Benchmark) - Going thorough all 10 chats: 11635,11207,11363,11352,11279,11183,11137,11145,11032,11057. You can paste 11635,11207,11363,11352,11279,11183,11137,11145,11032,11057 into a cell in a LibreOffice spreadsheet, do "Data" / "Text to columns", choose , as a separator, hit "OK", and create a diagram.

Run online tests

For some tests, you need to provide the credentials to an actual email account. You have 2 ways to do this:

  1. (Recommended): Put them into the file ~/.gradle/gradle.properties (create it if it doesn't exist):

    [email protected]
    TEST_MAIL_PW=youpassword
    
  2. Or set them via environment variables.

Credits

The user interface classes are based on the Signal messenger.

License

Licensed GPLv3+, see the LICENSE file for details.

Copyright © 2022 Delta Chat contributors.

More Repositories

1

deltachat-desktop

Email-based instant messaging for Desktop.
TypeScript
911
star
2

deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
Rust
656
star
3

deltachat-ios

Email-based instant messaging for iOS.
Swift
317
star
4

deltachat-core

Delta.Chat C-Library with e2e chat-over-email functionality & Python bindings
C
304
star
5

chatmail

chatmail service deployment scripts and docs
Python
127
star
6

deltachat-pages

Delta Chat Website
HTML
67
star
7

provider-db

Database of Email Providers and how well they work with DeltaChat
HTML
47
star
8

deltachat-node

Email-based instant messaging for Node.js.
C
45
star
9

yerpc

An ergonomic JSON-RPC server library in Rust with autocreated TypeScript client and OpenRPC specification
Rust
26
star
10

deltachat-cli

Delta Chat on the command line.
JavaScript
13
star
11

mailadm

mail account administration tool for temporary and other account creation/modification
Python
12
star
12

delta.chat-kaiOs

[WIP] Client for rooted KaiOS / GerdaROM devices
TypeScript
11
star
13

message-parser

Parsing of Links, Email adresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.
Rust
11
star
14

spec

E-mail-chat protocol specification
10
star
15

AndroidYggmail

Java
10
star
16

invite

Invite links for deltachat
TypeScript
9
star
17

eppdperf

This repository measures the performance of different email providers.
Python
8
star
18

dc40

Experimental deltachat client
Rust
8
star
19

deltachat-rpc-client-go

Delta Chat bindings for Golang
Go
7
star
20

interface

General and shared components and discussions relating to deltachat user interface
7
star
21

cosmos

Links to various neighbourhoods in the Delta Chat universe
HTML
7
star
22

deltachat-fp

Free Pascal bindings for Delta Chat
Pascal
7
star
23

webxdc-dev

Webxdc Development Tool
JavaScript
5
star
24

playground

scripts and experiments related to deltachat
Python
5
star
25

notifiers

Notify devices
Rust
5
star
26

deltachat-neon

Very experimental neon bindings for deltachat-core-rust
JavaScript
4
star
27

deltachat-jsonrpc

[WIP Prototype] webserver that wraps the core so you can talk json-rpc with it over websocket, now lives in core repo:
Rust
4
star
28

webxdc_docs

WIP documentation/guide website for webxdc
4
star
29

openrpc_type

A Rust crate to parse OpenRPC documents.
Rust
3
star
30

pingpong

Delta Chat bot to send ping-pong messages back and forth and measure latency
Python
3
star
31

napi-jsonrpc

use jsonrpc over napi.rs in nodejs
JavaScript
3
star
32

login-demo

This repository is outdated. You can find the better version of this repository here: https://github.com/deltachat-bot/discourse-login-bot
JavaScript
3
star
33

deltachat-desktop-dev-env

a wip/protoype of an deltachat desktop development enviroment
Shell
3
star
34

docker-images

Dockerfile
2
star
35

deltachat-emoji

An emoji collection for DeltaChat
2
star
36

workshops

Workshop resources
2
star
37

maps

JavaScript
2
star
38

deltachat-node-legacy

[WIP] Node bindings for deltachat-core
C++
2
star
39

docker-mailadm

Local testing environment for Delta Chat based on mailadm (https://github.com/deltachat/mailadm)
Dockerfile
1
star
40

deltachat-qt

Experimental Python/Qt GUI
Python
1
star
41

pyinfra-xdcstore

A pyinfra module for deploying xdcstore and xdcget.
Python
1
star
42

mail-server-tester

Mail server setup for testing
Dockerfile
1
star
43

pyinfra-acmetool

pyinfra deploy for acmetool
Python
1
star
44

pyinfra-borgbackup

pyinfra deploy for borgbackup
Python
1
star