8 ms·
Swift for Android would be a real milestone. There are not so many mainstream cross mobile development platforms.
by Gys 6y ago
Swift for Android would be a real milestone. There are not so many mainstream cross mobile development platforms.
- JamesSwift 6y agoXamarin
- akmarinov 6y agoKotlin Native React Native
- JamesSwift 6y agoEhh, kotlin MPP isn't far enough along for me yet. I'm biased against JS-based approaches. Xamarin is the best current option in my (very biased) opinion EDIT: but kotlin MPP is my long term hope. Once they iron out the kinks (e.g. ios coroutines)
- nwienert 6y agoI was skeptical of React native especially having tried it a few years ago, but new versions are incredibly nice. Plus, it’s running JS off thread. Performance has been fantastic. I rewrote recently an app in SwiftUI - the React Native app was faster and easier to write. Which was a surprise to me because I like the SwiftUI components more, but in the end the far superior hot reloading and far better dev tools, along with the much better flexibility (less time “getting the code/types to run”) meant I was moving about 5-10x faster. Finally, we are sharing almost 100% of code across native and web. We built a component kit designed to use react-native-web and that handles just a few edge cases, and the net result is quite awesome. We do obviously have it designed to look different when mobile, but it’s the exact same as the web responsive mobile. The web version adapts nicely based on screen size as well. So unlike Flutter you’re not having to deliver a massive web bundle with tons of incompatibilities and perf issues. And unlike any other language you’re fully cross platform. I ran it for the first time the other day on Android just to test if it worked and it did first try, no code change necessary. I’ve definitely changed my opinion - React is not just viable, but preferred to me, even if I could theoretically move as fast with a native app in each language.
- JamesSwift 6y agoYeah my one time getting into react native was not good. Ran into several show stopping bugs with the build tooling basically immediately. Hot reload is absolutely a killer feature though and I wish I could have stuck with it for that alone. My issue with JS isn't the fact that its on/off the main thread, its that it is _necessarily async_ due to the bridge. That is _really_ limiting to design around. Thats why Xamarin is in many ways the best of both worlds for mobile dev. If WASM/client-side-blazor take off then it can also target web.
- nwienert 6y agoActually curious how it’s limiting being async? I’m doing some intense animations and interaction so far with no trouble.
- JamesSwift 6y agoAre you doing the heavy lifting on the native side? I haven't used react native for a while so I don't know the facilities it offers, but my understanding was navigation/animation were not really solved yet. I would also be curious about what devices you are validating the interactions on. Is it a wide range, or mostly newer models? For async issues, the canonical example I can think of is state restoration for when an app/activity is reaped by the system. These are synchronous platform APIs and so your options are very limited on how you plan to support them. Another example would be doing any sort of IO/background processing in the JS context that happens to return during interaction/animation that is also in the JS context.
- nwienert 6y agoAh yea I haven't run into the state restoration thing. Fabric[0] is fairly exciting though, and seems like it will have a sync API. I think they've improved quite a bit on animations, the Animated library has worked well for me with PanResponder, I was able to get a pretty complex bottom drawer interaction working (much like Apple Maps) where you need to handle bubbling events with multiple nested scrollable areas and dragging that inits only when scrolled to top, etc, all came together very smoothly. In SwiftUI it was a similar API, but far more work to get to behave and in the end I was doing some hacky stuff to get it finally fully behaving. Granted, SwiftUI is early stage, so perhaps in a year or so it will also have figured all this out. As for testing, we've tested on a $100 two year old Android device with success, but nothing truly old. [0] https://github.com/react-native-community/discussions-and-proposals/issues/4 https://github.com/react-native-community/discussions-and-pr...
- EvilEy3 6y agoKotlin, Flutter, Any JS framework, QT, Xamarin.
- pier25 6y agoFlutter is probably the best candidate. It's a shame Google is giving priority to Flutter for Web instead of desktop though. As discussed previously here on HN, Flutter for Web will always result in bloated web apps as they are reimplementing everything through canvas (eg: text editing, layouts, styling, etc).
- timsneath 6y agoQuick note here: we're investing in both pretty heavily. Google has a fair amount of pedigree on the web, so it's highly attractive to us to have web support, but we're paying close attention to the attention that desktop is receiving and are accordingly putting resources on it. More news tomorrow, but see, for example: https://www.windowslatest.com/2020/09/21/google-flutter-uwp-apps-for-windows-10/ https://www.windowslatest.com/2020/09/21/google-flutter-uwp-... (Disclosure: if it's not obvious, I'm on the Flutter team.)
- pier25 6y agoGood to know you're paying attention. Hopefully Flutter will be able to replace tons of Electron apps.
- pjmlp 6y agoXamarin, Qt, Flutter, Webviews
- kitsunesoba 6y agoSwift alone would be nice, but implementations of UIKit and/or SwiftUI for Android would be even better. SwiftUI in particular makes a lot of sense as a cross-platform UI framework, since its appearance and behavior adapts to the platform it's running on instead of trying to shoehorn in a single look and feel everywhere.
- Gys 6y agoSorry, yes I meant to include SwiftUI (which I assume is to succeed UIKit).
- JamesSwift 6y agoIf thats what you are after then flutter is available today
- jmull 6y agoFlutter doesn't use native controls/frameworks under the hood, so it generally falls into the category of "trying to shoehorn in a single look and feel everywhere".
- kitsunesoba 6y agoYes, precisely. It has a "Cupertino" theme that kind of mimics the iOS look and feel, but it misses the mark and will always be behind the curve a least a release or two in matching the OS.
- JamesSwift 6y agoOK I misunderstood your ask then. In that case Xamarin.Forms does that today
- cercatrova 6y agoIt enables a lot more customization and complex effects precisely because it draws every pixel itself.
- wasyl 6y agoI think Kotlin is ahead enough in this area that it'll win. Plus it's much easier to compile Kotlin to native and use that from Swift than to use native from Java/Kotlin
- jamil7 6y agoYeah it just reached alpha. I’m using Kotlin to power a side project on iOS with a SwiftUI view layer. I’ve yet to actually implement the Android version though.
- brantonb 6y agoWe’re looking to rewrite a legacy C++ shared component that had become unmaintainable and are considering Kotlin native, mostly because it will be easier to hire for a mobile component written in one of the four primary mobile languages. How is your experience using it on iOS?
- jamil7 6y agoOverall really good, I picked it up pre alpha and haven’t needed to change that part of the codebase too much since then so can’t tell you how much has improved, it was stable enough for me even then. It’s extremely flexible and doesn’t require you to buy in completely, I’d recommend trying out a small framework first to see how it could work for your team. It suffers from the various early adopter type issues, not many third party packages etc but the jet brains docs and tutorials are pretty good, compile time also isn’t the fastest yet but they’re working on it. Kotlin’s async model can tale a bit to wrap your head around if you’re new to it too. Interfacing with the host platform is also pretty painless compared to the react native or flutter process.
- deleted 6y ago[deleted]
- bsaul 6y agoReaddle apparently built spark (their client mail app) using a single swift core module compiled to all platforms, including android. They released a custom swift toolchain to target android. Unfortunately there doesn’t seem to be a lot of interest from the swift core team, because i couldn’t find any official info on the state of android compilation (what part of the stdlib works, what doesn’t, and how to interop from java /kotlin to something compiled with swift).
- Can_Not 6y agohttps://scade.io https://scade.io