iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.93k stars 1.18k forks source link

Does this library support Android? #741

Closed Joe23232 closed 3 years ago

Joe23232 commented 3 years ago

Hi does this crate support Android, if I were to use something like android-ndk-rs crate along with iced?

13r0ck commented 3 years ago

No. Mobile is planned in the FAR future

Joe23232 commented 3 years ago

I am a little new to Rust so I am apologise in advance if I do not understand, but like if I am using android-ndk-rs crate which allows me to use the API of Android, am I not able to use this crate still and to get it to display on the screen?

13r0ck commented 3 years ago

No worries! Welcome to rust! I wish it worked that way, but unfortunately no. You have the order flipped a bit. Iced is not visual widgets that are fed into a visual framework. Iced abstracts the windows/linux/web visual frameworks into widgets. For iced to work on android it would have to be re-written to call the Android APIs to build the widgets. It is totally possible, but would require a re-write of the foundation of Iced.

Rust still early days when it comes to UI programming. The most up to date list is kept here: https://www.areweguiyet.com/

Joe23232 commented 3 years ago

No worries! Welcome to rust!

Thanks mate :)

I wish it worked that way, but unfortunately no.

That's a shame :(

You have the order flipped a bit. Iced is not visual widgets that are fed into a visual framework. Iced abstracts the windows/linux/web visual frameworks into widgets. For iced to work on android it would have to be re-written to call the Android APIs to build the widgets.

I see mate.

It is totally possible, but would require a re-write of the foundation of Iced.

I hope it soon comes to Android, would love to use it =D

It is totally possible, but would require a re-write of the foundation of Iced.

Rust still early days when it comes to UI programming. The most up to date list is kept here: https://www.areweguiyet.com/

Would you happen to know another easy to use GUI crate (like this one) but it supports Windows as well as Android?

Kaiden42 commented 3 years ago

For iced to work on android it would have to be re-written to call the Android APIs to build the widgets.

As far as I know only partial. Iced is rendering the GUI using some Renderes like wgpu or glow in a windowing shell like winit or glutin. Both winit and glutin are developed by the same devs like android-ndk-rs and could technically work on android (never tried it so I can not gurantee that it works). But having the foundations to support android is only half the step. Iced itself needs to sopport it too. For example: The textinput would need to call the android api to open up the virtual keyboard. So for short - rendering of the GUI could work already - interacting with it only partial (touch input should work).

Joe23232 commented 3 years ago

I see, interesting, is there like an issue that is created where they are currently trying to have better support for Android if you happen to know?

13r0ck commented 3 years ago

I see, interesting, is there like an issue that is created where they are currently trying to have better support for Android if you happen to know?

There is #302, mobile support is a LONG way away. It isn't even on the road map. Being realistic well over a year away from even alpha level functionality.

I am not aware of any rust crates for windows + android UI dev. I'm sure there will be eventually, but at this point the best way to do that and still write some Rust code would be Rust as a backend with JS + Electron + React Native for the UI..

You asked for an easy crate for an easy crate for windows + android dev UI dev. As far as I'm aware there is no easy way to do that in any language... I wish you luck!

Joe23232 commented 3 years ago

Thanks mate :)

hecrj commented 3 years ago

Let's keep the discussion in #302 for now.