Open ogoffart opened 3 years ago
Is there any progress here? I've found that both winit
and glutin
has Android support.
Not really. There is some work in progress to make it compile in the olivier/wip/android
branch, but it doesn't work yet. Some more work will be needed to adjust the way the window is initialized.
Hi, I've forked @ogoffart 's repo and I've finally managed to build a working printerdemo
example here by using cargo-apk.
The main issues I've had to solve are:
delaying the initialisation of the window, until the event loop receives a InitWindow
event (which means that Android is ready to create it):
The fastest (and obviously not the most elegant) way is to block android_init
using a loop. (the path I've taken)
The best way would probably be to make surface, gl context and other stuff optional, as other projects have already done.
disable fontconfig
, as the ndk doesn't ship a bundled version and Android seems to ignore every self-compiled library one adds to the apk:
If I've understood correctly the code I've read, the same thing is done for wasm32 builds.
Overall, everything seems to work decently (considering that this was a test), apart from the fact that, as soon as one tries to switch app, Android destroys context and surface and the application crashes (for the same reason of point 1.).
I hope this will help to speed up the development. Thank you for your work!
Great work!
One aspect that might need support in the run-time library APIs or perhaps even the .slint language is first-class support for the Android Activity Lifecycle. The Android Activity Crate supports these state events, and we may want to integrate this with callbacks to the application - ideally in a platform independent way that the same API could be used also on iOS.
We've made an initial plan for how we'd like to break down the Android port and I'd like to share it here for further editing/discussion. I'll edit the current empty description of this issue for that purpose.
Is there a roadmap or plan with timetable for mobile support?
Is there a roadmap or plan with timetable for mobile support?
We have not made a plan beyond the breakdown and time estimate outlined in the description of this issue. We want to learn from the Android port first and then have a better idea about what additional functionality and features we need to support also iOS and mobile specific features in general. This initial work on Android is also limited to Rust as target programming language.
This project is funded through NGIO Core via NLNet - https://nlnet.nl/project/SlintAndroid/
Here's a possible breakdown of tasks that we devised. We estimate this in the range of ~4 months of work.
Update: Check the documentation to try the android backend: https://docs.rs/slint/latest/slint/android/index.html