Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Can this library run on mobile platforms? What should be taken into consideration? #1

Open
xinyuliangigg opened this issue Apr 24, 2024 · 1 comment

Comments

@xinyuliangigg
Copy link

dart-lang/native#218 (comment)
I came from this issue.

@Davenchy
Copy link
Owner

Davenchy commented Apr 24, 2024

Hello, thank you for reaching out.

Regarding the possibility of running this library on Android platforms, there's some uncertainty. While it's theoretically possible, I haven't personally attempted it, and I don't have significant experience in this domain to provide a definitive answer.

The provided example builds a libwrapper.so library on a Linux machine, which relies on libtorrent-rasterbar.so functions without C++ name mangling. However, please note that my testing has been limited to Linux, and I haven't explored compatibility with other operating systems or platforms.

Please note the following:

  • I developed and tested this example on Linux and haven't tested it on Windows or macOS.
  • The linkage is dynamic, meaning the Dart binary will search for the libwrapper.so file in the same working directory. Additionally, the wrapper library expects libtorrent-rasterbar.so to exist and be accessible on your system.

You have the option to modify the Makefile to statically build the libwrapper.so library.

Regarding Android

If you decide to pursue Android compatibility, you may need to statically build the wrapper library and integrate it into your Flutter project. However, since I haven't attempted this myself, I can't provide detailed guidance at this time. Additionally, Android devices likely have different architectures, so cross-compiling the library may be necessary. I lack experience in this field but recognize it as a potential consideration.

I found this resource that could assist you further:

Also this Repo could be helpful:

This is the libtorrent docs for downloading and building:

I hope this provides some clarity. If you have further questions or insights, feel free to share them. And please, do let me know your progress if you manage to explore this further.

@Davenchy Davenchy pinned this issue Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants