I want to create a tablet app that can also run on desktop. I have some experience using compose for...
a
I want to create a tablet app that can also run on desktop. I have some experience using compose for mobile. Can an android app be easily made to target desktop like Flutter? Thanks
l
You would want to make sure that your other libraries are JVM compatible, but using Compose, the UI will be shareable.
a
@Landry Norris what about navigation, background work, Android specific stuff like Fragments etc?
l
Fragments won’t be shareable, but navigation can be depending on what you use for state management. I use #decompose for state management, which has desktop support.
Anything that isn’t pure JVM can be expect/actualed, but most things (files using okio, http using ktor, state management using decompose/others, UI using compose, etc) have libraries supporting cross-platform.
a
@Landry Norris so I can basically replace android navigation with decompose? I’ve read about it before. Have you used it? Is it pleasant to work with? Thanks!
✔️ 1
l
I like using it. There are other alternatives if you have any issues, but I’ve been happy with it. I will admit I haven’t used it on desktop yet, though.
K 1
👍 1
a
Thanks @Landry Norris. I appreciate your reply. I’m considering Flutter at the moment. I was a native only person but looking at their newest developments, it looks like a truly viable choice to me now.
l
I will say that from my experience with Flutter, it’s a great choice if everything you need is currently supported and you can get away with only using dart, but if you need to do anything native, it’s really a pain. I also hit a wall where I can’t continue with (admittedly fairly complex) features without a ton of extra work. But for simple apps, it’s still a good choice. Be careful with Flutter desktop though. It was just marked as stable, but there’s not currently a ton of support since it’s so new.
👌 1
a
Thanks. BTW do you mind sharing the wall you hit with flutter?
l
At work, I maintain a custom video player (we need features that ExoPlayer and others generally don’t provide). It integrates with libav/ffmpeg C libraries. Dart has an ffi layer, but it doesn’t seem to have an equivalent to the cinterop tool K/N has and the performance wasn’t up to what we needed with ffi (it would probably be faster in release mode, but the debug experience was essentially unusable).
🙏 1
a
Thanks for sharing Landry. You’re right slow-mode debugging is no fun.
l
Keep in mind, though that I was doing very low-level work. Flutter should be fine for simple things.
👌 1
a
Got you. That’s exactly what I thought. In fact, I was amazed it’s even possible to do what tried to implement.