tdlight-java icon indicating copy to clipboard operation
tdlight-java copied to clipboard

[Question] Support for Android

Open vellrya opened this issue 3 years ago • 11 comments

Hello, thank you for your fantastic work!

I searched carefully for any information in your git repository, but did not find an answer to the question, can tdlight be used on Android? If not, maybe I can use wrapper with the official library?

I have not worked with native libraries before, thanks in advance for the clarification)

vellrya avatar Mar 21 '21 12:03 vellrya

Unfortunately this wrapper is not made for Android because I don't know the limitations/peculiarities of the Android runtime.

Also, it seems that tdlib itself is very difficult to build for Android, so I can't compile the natives for Android.

cavallium avatar Mar 21 '21 12:03 cavallium

But its possible (example with not optimized tdlib): https://github.com/osmandapp/OsmAnd/tree/master/OsmAnd-telegram

vellrya avatar Mar 21 '21 12:03 vellrya

It's possible but I don't have the time and the necessary skills to add Android support to tdlight-java.

I'm leaving this issue open, if someone wants to make a pull request with this feature in the future I'll appreciate.

cavallium avatar Mar 21 '21 12:03 cavallium

By the way, the optimized variant is mainly for bots, if you are making a GUI client you should use the non-optimized variant.

cavallium avatar Mar 21 '21 12:03 cavallium

I think I cannot create something better then official client :)

I need to use only small part of telegram client api such as file/media download as part of my app (I don't even need messages), thats why I think optimized library should be good for this purpose.

vellrya avatar Mar 21 '21 12:03 vellrya

It's possible but I don't have the time and the necessary skills to add Android support to tdlight-java.

I'm leaving this issue open, if someone wants to make a pull request with this feature in the future I'll appreciate.

I can help you. I am an android developer and had great experience in building android libraries. But, I need a reference guide for using this lib.

ErrorxCode avatar Dec 16 '21 16:12 ErrorxCode

I can help you. I am an android developer and had great experience in building android libraries. But, I need a reference guide for using this lib.

https://github.com/tdlight-team/tdlight-java/tree/master/example

cavallium avatar Dec 17 '21 12:12 cavallium

It's possible but I don't have the time and the necessary skills to add Android support to tdlight-java. I'm leaving this issue open, if someone wants to make a pull request with this feature in the future I'll appreciate.

I can help you. I am an android developer and had great experience in building android libraries. But, I need a reference guide for using this lib.

how about

passerbyo avatar Jun 30 '22 04:06 passerbyo

SCR_20240303_101027

In addition to Android support, it is also necessary to resolve the issue of compatibility with some methods that use classes that are only available in Android O and above.

For example, java.nio.file.Path.

tretdm avatar Mar 03 '24 03:03 tretdm

SCR_20240303_101027

In addition to Android support, it is also necessary to resolve the issue of compatibility with some methods that use classes that are only available in Android O and above.

For example, java.nio.file.Path.

java Path has existed for 13 years, I will not use the 1996 alternative because Android refused to support basic java APIs until Android O. However, Android O has been around since 2017, so I'd say it's more than enough to support the 6 most recent versions.

cavallium avatar Mar 03 '24 09:03 cavallium

@tretdm you can try core library desugaring https://developer.android.com/studio/write/java8-support

andrew-ld avatar Mar 03 '24 11:03 andrew-ld