-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Mobile support #302
Comments
There are no plans to officially support mobile platforms for the time being. We are focusing on desktop platforms first. That said, while I cannot commit to maintaining mobile-specific code, I'd love to see any exploration in this direction. For instance, @simlay added touch support in #57 and I believe they are also experimenting with UIKit. |
Yeah, at this point in the iced project I (or anyone really) should probably write something of an RFC about adding iOS support to discuss things about maintainability and what not. It's a pretty substantial undertaking but not crazy to add iOS support. The biggest concern I have is maintainability. Like for example every new widget feature will need to be updated in the iOS support and there's just not many people that know the weird and annoying things with iOS rust programming so it may be a bit slow. |
That said, I think Iced & Rust would have a lot of value to add if compiled to ARM64-native targets, and not using HTML for compositing. In fact, Iced could be a fantastic way to keep all development in one codebase-- a React / Electron / React Native developer's dream. I cannot understate the value this could provide. I understand you're just one developer, but the impact of this project on application development could be enormous. React has performance issues when scaling, and to sidestep the need for DOM overhead, virtual DOM or repaints entirely would be incredible. WASM binaries are easier to optimize, as well, due to a degree of confident dead code removal that isn't safe to do on JS. The most we can do is tree-shaking of dependencies, and even that is imperfect. As for React Native and Electron, they also have their respective performance issues. Being able to deliver native app performance, without the overhead of a browser and JS interpreter, just using native target instructions on desktop and mobile apps, would lower size on disk alone by about two orders of magnitude (many 100s of megabytes of Electron or React Native apps, to fewer than 10 megabytes, for most projects). The subsequent impact on resource usage cannot be understated. That's my vision for this project, and I know it absolutely can be done. The major obstacle is platform idiosyncrasies themselves, but those implementation details, that can be abstracted away by the package in the same way wgpu and native renderers already do, or handled inline with macros, in the same way some small parts of the application might be written differently for web than on native. What's frustrating is, you already have precedent for the modularization of renderers, and that could be incredible for supporting development on pretty much all platforms. Maybe a CLI "UI" could be the icing on the cake... 😹 I would suggest updating your Roadmap, since it's already sorely out of date, and putting the call out for help with this goal, on both iOS and Android. You absolutely are correct for wanting to focus on the core codebase, and what you know best. I just think the adoption of Iced would be enormous, if mobile devices are developed for and supported, as well. And keep in mind, Hector, you've always made it clear this is an alpha project. But imagine if it could fill the shoes of SPAs, Electron apps, and React Native apps, and do it way better (faster and with one codebase in one language-- Rust). |
I can't commit to this responsibility now as I'm still in the research phase, and wouldn't be beginning the efforts for at least 6 months. That said. My team and I might be interested in assuming responsibility for all things mobile. Ware about to launch an iOS app (native UI via Texture Group then all custom everything and animations built on top of that) once the virus situation is over. And for our 2.0, creating an Android version is priority # 1. But rather than creating and maintaining a native iOS app + an Android (because performance is critical for us) and all the endless headaches that would entail, I've been thinking there's no reason why nowadays that there isn't a platform agnostic UI library that provides "native over vulkan" (because let's leave OpenGL in it's grave lol). And that if there weren't one already, then it might be worth our time to build. Which lead me here to you all, and i'm vibing with the fact we seem to be on the same page about this. |
I just bumped into this project, looks very interesting. I'm surprised it's not mobile-first (and desktop-second) like all other popular agnostic platform UI toolkits out there nowadays. IMNSHO that's the key to their success (e.g. Xamarin.Forms), because desktop is fading... Maybe instead of adding mobile support to iced, it's simpler to create a new toolkit (similar to iced) toolkit that abstracts Android and iOS only at first, and later add desktop. This is just my 2cents because I cannot commit to this effort, but if it was done this way and works, I'd probably move out from .NET altogether and embrace Rust for all my dev needs! Happy hacking. |
I wonder where one would even start implementing an abstraction layer... The desktop rendering backend uses Vulkan so could that be copied? I guess the hard part would be dealing with all the various APIs for permissions and inputs and such. |
We could probably take a look at how flutter does it. |
Hum, I don't understand 🤔 Both Wouldn't it be simpler to force the use of the The I feel like I'm missing something, can someone enlighten me? |
@librelois I'm not a mobile developer, so there may be some "devil in the details", but I've wondered similar with regards to cargo mobile, since it supports both renderers. |
Ya, basically everything it relies on already supports android (to some extent). Took about an hour to get most of the examples working.
Even though that's several things, most of it is super simple to do, otherwise everything else just seems to work. depending on time commitments, might be interested in getting this moved forward, at least for android. don't have iOS nor a mac so can't really help there (most things should be cross plat, but there might be specific bugs I'm unaware of). More interested in moving to wgsl (hopefully everything needed is supported) and killing off shader-c before doing the android stuff. |
I 'ported' Iced to be able to run on my PinePhone (https://bics.ga/reivilibre/iced-mobile/src/commit/2dc42b4a22ffc31a83297bfed7641e3737a0a940 if anyone is interested in the code; there is a tour_glow example for demonstration), which basically just came down to making the code compatible with older OpenGL (including hecrj/glow_glyph#4). It actually looks quite good, but the following issues/considerations need to be kept in mind:
The awkwardness around tapping things may be because we need to handle touch events specially (and make those toggles a bit bigger for mobile!). Other than that, I don't think we're too far away from having something working quite nicely -- though it would be nice to add support for Images to the glow backend eventually (c.f. #846). |
i think it would be super helpful if we put together an agenda of work that would need to be accomplished to achieve full iOS and Android support |
if you force the x11 winit backend touch works fine |
@Dispersia could you share the steps you took to make it work because it looks like it would totally work in my usecase for a private app asking me question about an exam which i would like to do on my phone |
@Dispersia yes, please do share if you can. Would love to see it as well. |
@Dispersia, I'm also interested in what you did to make mobile work. I'm curious more about iOS but doesn't hurt to know what you did, in principle, to get it working on Android. |
@dejang Sorry, unfortunately that was years ago and I don't think i had any steps outside of what I described under the post, and don't know if they're even still applicable (draw types were changes in wgpu so that might not be needed anymore, and the winit bug was definitely fixed) Otherwise I just kept running it, it failing, then fixing it and going to the next problem haha. Sorry I can't help more, as I haven't touched Iced since the android issue was closed with them not wanting to support it and went a different path (this is in no way shade to the project, just didn't fit my needs since I was wanting it for mobile) |
Is it possible to build for web and use webviews to render on mobile? Like how Dioxus does it? |
Unless you're referring to canvas, this would defeat the purpose of using something like iced to do high-performance rendering. |
Current state of affairs is that integration example works on android with almost no changes. Since iced relies on softbuffer, there's a work-in-progress fix for it And here's a working example |
thank you |
is there any plan to make iced library for mobile? (like Android,iOS )
The text was updated successfully, but these errors were encountered: