News for hackers. Stuff that matters.
Re:Alibaba Puts SDK Flutter to the Test by hliyan on Monday April 15, 2019 @12:51AM (#19663182)
Found this while evaluating options for moving away from React Native (which is not really working well for us). As much as I love Flutter/Dart, the big problem: most of our users are on iOS, and Flutter being a Google project, seems to prioritize Android over iOS (RE: UI polish and runtime performance). Looks like we'll be sticking to native dev for a while...
Re:Alibaba Puts SDK Flutter to the Test by sgt on Monday April 15, 2019 @05:08AM (#19664091)
My view is simply that native is practically always better - if you have the resources to maintain two codebases. The biggest risk I see is that you're running two separate development teams (Android and iOS) with varying skills.

On our last project, the Android code was of much worse quality than the iOS one (perhaps due to both tooling and Java null pointers; which can be attributed to poor development skills), so the projects did not match in terms of quality and sometimes even the way features behaved.

Re:Alibaba Puts SDK Flutter to the Test by com2kid on Monday April 15, 2019 @02:04AM (#19663385)
What sort of issues have you been running into with RN?

As of late, the spit and polish for React Native on Android has been getting better, with some features even being exclusive to Android here and there. Though personally I am super interested in Fabric, if they really do make native calls as easy and performant as they say they will it will make RN dramatically closer to native platform development.

Re:Alibaba Puts SDK Flutter to the Test by hliyan on Monday April 15, 2019 @03:48AM (#19663799)
Possibly unfair to point the finger at RN here, but we found that the amount and complexity of code involved in developing using RN + JS + Redux was much higher than when just using Swift (< 50%). We've yet to repeat the experiment with Android/Kotlin, but I'm confident we'll get similar results.
Re:Alibaba Puts SDK Flutter to the Test by kitsunesoba on Monday April 15, 2019 @01:57AM (#19663360)
IMO, every attempt thus far has approached cross platform entirely the wrong way. They’re all way too focused on providing deeply custom UI. I believe that it may better to instead abstract app navigation as its own separate thing, making it a setting in a config file (e.g. tabbed, hamburger, split-pane tabbed, etc) and restricting UI coding to individual screens, which would have style hinting abilities and could be built via any number of platform agnostic (and perhaps language agnostic) ways. All this would then compile down to native UIKit, Android SDK, UWP, AppKit, etc.

So the idea would be you program your app’s individual screens, throw in some styling, select platform appropriate nav schemes (hamburger for android and tabbed for iOS for example) and hit compile to generate native per-platform project files+code.

This sort of solution wouldn’t cover more complicated navigation schemes or use cases that actually require highly custom UI, but if you’re doing either of those you’ve probably outgrown any kind of cross platform solution anyhow. Realistically I believe this would work well for probably 80-90% of non-game apps and wouldn’t suffer many of the drawbacks that usually come with “silver bullet” style cross-platform setups.

Re:Alibaba Puts SDK Flutter to the Test by aaronbrethorst on Monday April 15, 2019 @02:45AM (#19663568)
Or you could abstract out the model, networking, persistence, and other services logic from your app into a reusable library,—and then consume that from a native, unshared frontend.

I'm hoping that Swift becomes sufficiently viable on Android that I can reuse library code across iOS and Android sometime in the next few years.

Re:Alibaba Puts SDK Flutter to the Test by jon-wood on Monday April 15, 2019 @09:36AM (#19665173)
This is much what Xamarin does, encouraging you to have a common core, and then implement the UI for each target platform separately to fit the platform’s style.
Re:Alibaba Puts SDK Flutter to the Test by fstephany on Monday April 15, 2019 @03:20AM (#19663691)
Looks like Kotlin gets the lead in this area with Kotlin Native.

Jetbrains moves pretty fast and the integration works surprisingly well for something this young.

Re:Alibaba Puts SDK Flutter to the Test by kitsunesoba on Monday April 15, 2019 @04:57AM (#19664045)
As great as jetbrains is, I think Swift has much better long term potential in terms of FOSS tools. The Swift language server Apple is currently working should bring an open tooling avalanche.

In fact I think the high quality of jetbrains IDEs might actually impede Kotlin tooling development… why bother when first party tools are so good?

Re:Alibaba Puts SDK Flutter to the Test by oblio on Monday April 15, 2019 @05:27AM (#19664148)
The thing is, developers outside of Apple platforms don't really adopt Apple techs. Objective C never took off and the same seems to be happening to Swift. I don't know anyone using it on Linux.
Re:Alibaba Puts SDK Flutter to the Test by kitsunesoba on Monday April 15, 2019 @06:24AM (#19664326)
Objective-C’s cross platform use was crippled due to half of its essentials being tied up in Cocoa. Objective-C by itself doesn’t even have memory management.

Swift doesn’t suffer this issue — it’s been built for multiplatform use from day 1. There are still some discrepancies, but today Swift on Linux is about as usable as Swift on Apple platforms. There’s even several (4+ last I checked) modern web frameworks for Swift and even GTK+ bindings.

On top of this, its Windows port recently reached a useable state and there’s work being done on a Win32 bindings. Once that’s done, it will be possible to write an app with a common core and 3 different UI layers all in Swift which connects to a web API written in Swift. That’s already leagues beyond what was ever achieved with Obj-C and momentum is continuing to build.

Re:Alibaba Puts SDK Flutter to the Test by oblio on Monday April 15, 2019 @08:08AM (#19664714)
Ok. But the questions now is: why would you adopt it?

You could use Java/OpenJDK or even Kotlin/OpenJDK.

You could use dotnet core.

You could use Node.js with Typescript.

Or Python/Ruby/PHP/...

All those are mature and support all major operating systems way better than Swift does.

I'm not sure what Swift's Unique Selling Proposition is. From where I'm looking it seems to be: "it's backed by Apple".

Re:Alibaba Puts SDK Flutter to the Test by saagarjha on Monday April 15, 2019 @06:34AM (#19664368)
> Swift on Linux is about as usable as Swift on Apple platforms

Eh, I wouldn’t say that. I don’t see it significantly ahead of say GNUstep is for Objective-C; Swift on any platform other than macOS is still pretty much a second-class experience.

Re:Alibaba Puts SDK Flutter to the Test by pjmlp on Monday April 15, 2019 @03:27AM (#19663719)
I consider a big mistake that Kotlin/Native doesn't share the same semantics with pure Kotlin.

However since it is still beta, this might eventually change.

And it does require getting licenses for Clion and AppCode, for the full developer experience regarding Kotlin/Native, versus C++ that is already there in XCode and Android Studio.

Re:Alibaba Puts SDK Flutter to the Test by hliyan on Monday April 15, 2019 @03:26AM (#19663717)
Have you attempted cross platform development with Kotlin [1]? If so, how is your experience?

[1] https://proandroiddev.com/we-built-our-ios-and-android-apps-...

Re:Alibaba Puts SDK Flutter to the Test by kitsunesoba on Monday April 15, 2019 @04:52AM (#19664025)
Yeah, that wouldn’t be too bad. The main need when doing something like this would be a networking library that uses system provided networking (NSURLSession, etc) under the good rather than curl or something like that — not that curl or whatever else is bad exactly, but you’d be losing out on radio use optimizations among other things.
Re:Alibaba Puts SDK Flutter to the Test by hliyan on Monday April 15, 2019 @02:57AM (#19663613)
> abstract out the model, networking, persistence, and other services logic from your app into a reusable library,—and then consume that from a native, unshared frontend

Oddly enough, this is what we're going with...

Re:Alibaba Puts SDK Flutter to the Test by saagarjha on Monday April 15, 2019 @06:31AM (#19664353)
I’d suggest using C++ or a language with C bindings if you want this today (or even in the future).
Re:Alibaba Puts SDK Flutter to the Test by aaronbrethorst on Monday April 15, 2019 @11:57AM (#19666224)
And then I’d have to write C++. No thanks :-/
Re:Alibaba Puts SDK Flutter to the Test by pjmlp on Monday April 15, 2019 @04:53AM (#19664031)
That is exactly what Office team and Dropbox are doing with their mobile apps.

Microsoft used the term hamburger development at their CppCon presentations, with the meat being the C++ code and the bread for the native glue and views. :)

Naturally one can use something else other than C or C++ for the library code, but then there is the additionall effort of adding yet another toolchain and debugging layer into the process.

Re:Alibaba Puts SDK Flutter to the Test by wurst_case on Monday April 15, 2019 @03:10AM (#19663659)
You can do this with Flutter. Flutter provides two packages for ui: material and Cupertino. But you an make your own package using Flutter. This is something I'm doing right now in fact.
Re:Alibaba Puts SDK Flutter to the Test by kitsunesoba on Monday April 15, 2019 @04:59AM (#19664058)
Unless I’m mistaken, the Cupertino package isn’t using real UIKit controls… they’re just Flutter controls skinned to look like UIKit and drawn to an OpenGL context. My proposed solution is built to use actual UIKit under the hood on iOS.
Re:Alibaba Puts SDK Flutter to the Test by saagarjha on Monday April 15, 2019 @06:30AM (#19664347)
Flutter’s “Cupertino” theme is poor facsimile of native UIKit controls.
Re:Alibaba Puts SDK Flutter to the Test by pjmlp on Monday April 15, 2019 @01:42AM (#19663328)
I rather go with mobile Web for apps that should be web sites to start with, or native views with C++ business logic.
Re:Alibaba Puts SDK Flutter to the Test by divan on Monday April 15, 2019 @07:48AM (#19664635)
Do you have any concrete examples of the effects of this "prioritization" or it's just speculation? I use Flutter almost exclusively for iOS and I haven't seen any difference in development or user experience so far.
Re:Alibaba Puts SDK Flutter to the Test by hliyan on Monday April 15, 2019 @08:06AM (#19664706)
UI polish and runtime performance, as I've mentioned. I said "seems to" because I only see the effects: the Cupertino widgets, and the marked performance differences on Android and iOS (see the Alibaba article). I don't know whether this is purposeful or a side-effect of something else.
Re:Alibaba Puts SDK Flutter to the Test by gardaani on Monday April 15, 2019 @04:00AM (#19663835)
Here's another performance comparison (2018). It compares Flutter to native iOS app. Flutter consumes 2x more CPU and memory for an app with 60fps rendering.

https://medium.freecodecamp.org/how-fast-is-flutter-i-built-...

Re:Alibaba Puts SDK Flutter to the Test by amarokaz on Monday April 15, 2019 @10:17AM (#19665455)
Flutter has had a lot of performance improvements since that date. It'd be great to see that updated compared to current version
Re:Alibaba Puts SDK Flutter to the Test by benjalimm on Monday April 15, 2019 @05:58AM (#19664231)
Correct me if I'm wrong. But it's possible to mix native with some Flutter + RN for laying out views right? I'm pretty sure that's what Instagram does (mainly in Obj-C but some views are in RN) and Snapchat (Flutter). Doing this would make sense when running apps on both platforms yea?
Re:Alibaba Puts SDK Flutter to the Test by heroic on Monday April 15, 2019 @08:51AM (#19664909)
How does this compare with the new RN architecture coming in? Does anyone know what kind of gains we can expect?
Re:Alibaba Puts SDK Flutter to the Test by tinus_hn on Monday April 15, 2019 @10:03AM (#19665345)
It is quite unfortunate no one cares about the Android on iOS monstrosities this framework creates.
Re:Alibaba Puts SDK Flutter to the Test by atalla on Monday April 15, 2019 @02:08AM (#19663405)
what about nativescript?
Re:Alibaba Puts SDK Flutter to the Test by kwindla on Monday April 15, 2019 @09:03AM (#19664965)
I was just looking at NativeScript and would love to hear about experiences developing production apps with it.

We have a pretty large javascript web app code base and have built both native and React Native ports. Both of which have had more cons than pros for us. So we ship on mobile as a web app.

The holy grail for us would be to use our javascript library code underneath native UIs (that we write ourselves) for both iOS and Android.

Re:Alibaba Puts SDK Flutter to the Test by jbverschoor on Monday April 15, 2019 @09:15AM (#19665039)
Just try it.. it's great