Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java? #9

Open
EchedelleLR opened this issue Mar 27, 2020 · 7 comments
Open

Java? #9

EchedelleLR opened this issue Mar 27, 2020 · 7 comments

Comments

@EchedelleLR
Copy link

Whats about implement the same bot in Java?

@Simon-Laux
Copy link
Contributor

Simon-Laux commented Mar 27, 2020

good idea, but unfortunately the java bindings are not standalone, they are part of the android client. so this could be a bit tricky.

@r10s
Copy link
Contributor

r10s commented Mar 27, 2020

the java bindings are pretty separated, though. they are in the folder https://github.com/deltachat/deltachat-android/tree/master/src/com/b44t/messenger

@EchedeyLR so, if you want to push this forward, you can copy this folder (together with the jni part) and use it. or just use the whole deltachat-android as a subproject. of course, i expect some things to be adapted. also a "high-level" api missing.

if there are actual bots in java, at some point, we can think over to separate this, however, this comes at costs, so the advantages and disadvantages should be weighted carefully.

@EchedelleLR
Copy link
Author

Thank you. I will check. As I never tried to mount a bot before I expected an example in the language I can use and try to extend from it.

@Simon-Laux
Copy link
Contributor

Simon-Laux commented Mar 4, 2021

The following imports depend on android / the android ui code:

DcEventCenter.java:
import org.thoughtcrime.securesms.util.Util;

DcChatlist.java:
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

DcContact.java:
import android.graphics.Color;
import android.util.Log;

DcContext.java:
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

DcMsg.java:
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.thoughtcrime.securesms.connect.ApplicationDcContext;

@r10s
Copy link
Contributor

r10s commented Mar 4, 2021

@Simon-Laux thanks for the list, i made a pr removing these dependencies, deltachat/deltachat-android#1825

@Simon-Laux
Copy link
Contributor

https://github.com/angelo-fuchs/dc-jni-playground is the attempt to make the java bindings standalone as a maven package

@link2xt
Copy link
Contributor

link2xt commented Apr 13, 2024

With deltachat/deltachat-android#2976 merged we still have Android-related hack
https://github.com/deltachat/deltachat-android/blob/430c15861abf9fa64fe5708843eaa5a3570f4bdf/jni/dc_wrapper.c#L10-L58

It provides fallback implementations for getauxval and recvmmsg functions which don't exist in NDK version used to build Android currently.

Also need to move
https://github.com/deltachat/deltachat-android/tree/430c15861abf9fa64fe5708843eaa5a3570f4bdf/src/com/b44t/messenger
into a separate module. util/concurrent/SettableFuture.java and probably ListenableFuture.java comes from Signal code, that would need proper annotation and the whole package would be GPLv3+ not MPL like the core then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants