News for hackers. Stuff that matters.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pzo on Tuesday December 04, 2018 @02:04PM (#18602589)
Writing plugins/bindings for native code in flutter doesn't look fun. Almost 100 lines of code to write binding for function that doesn't take any parameters and returns simple 'int' (int getBatteryLevel()). This just looks even worse than JNI to me. Don't want to even thing how long time it would take me to write bindings for function that do image processing. https://github.com/flutter/flutter/blob/master/examples/plat...

Which is sad because I would really want to have some fast and easy access to useful c++ libraries without wasting lots of time writing and maintaining tons of bindings for Java, ObjC, C.

We are on the verge of VR and AR and I don't see how flutter can help e.g. processing >100fps Video Feed using OpenCV library. The demo they presented on stage with ML and smile detection had quite big latency. I wouldn't call it real time.

So far it seems the easiest way to call c++ functions is using ObjC++ or Qt framework.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by smy20011 on Tuesday December 04, 2018 @02:08PM (#18602647)
I think you mixed UI code with platform channel code. The only code that use platform channel is this line.

https://github.com/flutter/flutter/blob/master/examples/plat...

I really hope flutter can provide a guide for FFI though.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by izacus on Tuesday December 04, 2018 @02:07PM (#18602638)
> We are on the verge of VR and AR and I don't see how flutter can help e.g. processing >100fps Video Feed using OpenCV library. The demo they presented on stage with ML and smile detection had quite big latency. I wouldn't call it real time.

I can't find any claim from Flutter team that 100fps video processing is even their goal. So that's a strange metric to measure it by - especially since it's competing against Javascript interpreted code which is far from fast by any metric.

> So far it seems the easiest way to call c++ functions is using ObjC++ or Qt framework.

On mobile? Qt really isn't pleasant or usable on mobile.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pzo on Tuesday December 04, 2018 @04:04PM (#18603586)
I have recently gave a look at Qt after 5 years and it seems lots of things have changed for the better. You get the same hot reload like flutter when modifying GUI using QML (with V-Play you can even hot reload not just on simulator/emulator but on real device). Qt material theme has good look and feel. Sadly iOS theme is a little bit lacking.

C++ is probably not the most productive language to write business logic but on the bright side Qt Company recently started supporting Qt for python (Pyside2) - sadly not on mobile devices for now. However it seems you can use PyQT5 on mobiles nowadays. This would be the best of all worlds IMO: 3 highly popular languages with rich libraries, tools and ecosystem -> C++ for speed critical code, Javascript/QML for UI and layout, Python for business logic and as a glue.

Qt also gives me more confidence that is not going away anytime soon. It survived many years and acquisitions (Trolltech, Nokia, Digia) and have some big clients/users in automobile and open source (KDE).

I will closely follow Flutter thought as well as React Native. The latter one also it seems noticed what a pain is writing all those bridges and looks like they are working on it to fix it with new architecture.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pknopf on Tuesday December 04, 2018 @08:55PM (#18605168)
You can also use .NET Core (instead of python) with QML/Qt.

https://github.com/qmlnet/qmlnet

note: I'm the author.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by nottorp on Tuesday December 04, 2018 @06:25PM (#18604441)
Sadly, Qt has so many threats on their download pages that I feel it's only suited to companies that can keep full time lawyers on payroll...
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by kbumsik on Tuesday December 04, 2018 @07:22PM (#18604748)
What? Qt is mostly LGPL. You don't need a lawyer.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by nottorp on Tuesday December 04, 2018 @07:24PM (#18604761)
Try to download it from qt.io. You will have to go through several screens saying "Are you sure you are able to comply with the LGPL? Wouldn't you rather get the commercial version for peace of mind?". If that isn't an implied threat, i don't know what is.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by kbumsik on Wednesday December 05, 2018 @01:31AM (#18606116)
I don't like this but I also kinda understand why they do so. Many devs around me (I live in Korea) don't care about GPL/LGPL and it is important for Qt to let them know. Qt is commercial software anyway.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by irishcoffee on Wednesday December 05, 2018 @03:03AM (#18606458)
Yum install epel-release

Yum install qt5-

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by freedomben on Tuesday December 04, 2018 @11:47PM (#18605752)
I don't approve of that tactic (in fact it drives me nuts), but I will say, Qt's license fees are quite reasonable, and then you get to link statically with no risk of violating the GPL.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by kristoffer on Wednesday December 05, 2018 @12:39AM (#18605917)
Reasonable? It's about $500 / month / developer with additional royalties if you are shipping devices with Qt firmware. Sure I think Qt/QML is the best UI toolkit available but this crazy pricing is driving me towards any possible alternative. So I'm really hoping Flutter will take off (for desktop/embedded as well, not only mobile).

Note that Qt is GPL3 nowadays so you can't really ship embedded devices with Qt without paying.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pjmlp on Wednesday December 05, 2018 @05:22AM (#18607051)
A great toolkit like Qt, including Qt Creator and UI designers, doesn't get written during late nights and weekends.

They are pretty cheap considering the typical prices on their target markets, embedded tooling, medical devices, enterprise solutions.

Naturally they decided to pivot to those markets, as Trolltech has hardly seen any significant monetary profit from FOSS.

So it is only fair that those that don't want to pay, also ship code free to the others.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by nottorp on Wednesday December 05, 2018 @07:01AM (#18607505)
Actually Trolltech was doing pretty well while selling Qt (which was full GPL at that time) for a fixed price per major version.

Then Nokia bought it and made it LGPL because they were planning on using it as the foundation for (some of) their mobile phones. Unfortunately, they couldn't decide which phones and went on a downwards slide.

Then Microsoft bought most of Nokia, and Qt got spun off into an enterprise thingy that takes their sales tactics from Oracle. Yes, I know the LGPL allows me to link dynamically for free, no, I don't trust Digia not to sue me for that.

Their pricing is also out of reach of anyone who's not in an industry that charges an arm and a leg due to regulation or niche.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by kristoffer on Wednesday December 05, 2018 @06:41AM (#18607400)
Most embedded tooling is free nowadays. Free software has eaten the world and will continue to do so.

I will use a free UI toolkit when I can. Qt will kill itself with their current pricing model.

Automotive is moving towards Android. Qt is not good for medical either because it is not really certifiable.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pjmlp on Wednesday December 05, 2018 @06:48AM (#18607432)
Actually what I predict is the return to shareware/public domain models, where the free software is only the tip of the iceberg of the stack one actually needs for production code.

The trend is already visible with SaaS, Cloud, IoT,...

Qt is certainly certified for medical use, https://www.qt.io/qt-in-medical/.

I have hardly seen any big Android Auto adoption.

The biggest foe of Qt in Automotive is Web stack.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by kristoffer on Wednesday December 05, 2018 @07:32AM (#18607640)
Ok I'll admit I'm not familiar with medical certification. I know that the so called Qt Safe Renderer for ISO26262 compliance is a bit of a joke at least.

I have seen two very big Qt projects being cancelled due to Android. Not the Android Auto app but native Android for IVI.

I don't see any indication of your vision for shareware. The trend is towards more and more software being licensed under licenses such as MIT.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by pjmlp on Wednesday December 05, 2018 @08:07AM (#18607851)
> The trend is towards more and more software being licensed under licenses such as MIT.

Which is exactly my point.

Give the tip of the iceberg for free, charge for everything else and give as little back to upstream, if anything.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by gcb0 on Wednesday December 05, 2018 @02:03AM (#18606233)
only if there was a startup doing embedded chips with gpl firmware...
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by 77pt77 on Tuesday December 04, 2018 @08:34PM (#18605077)
All you have to do is link dynamically.
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by oblio on Wednesday December 05, 2018 @05:09AM (#18606990)
> However it seems you can use PyQT5 on mobiles nowadays.

You can use it, but is it easy to use and build and deploy?

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by rsp1984 on Tuesday December 04, 2018 @06:36PM (#18604500)
> On mobile? Qt really isn't pleasant or usable on mobile.

Can't confirm. We've been using QML (part of Qt) and C++ to write cross-platforms applications (Android, Windows, Mac) for many years now without any major hiccups.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by rapsey on Tuesday December 04, 2018 @02:40PM (#18602945)
> On mobile? Qt really isn't pleasant or usable on mobile.

What's wrong with it?

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by dagmx on Tuesday December 04, 2018 @09:06PM (#18605203)
QtWidgets aren't really geared for mobile. QML however is fine
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by rockwotj on Tuesday December 04, 2018 @08:41PM (#18605123)
Some boilerplate to write a custom native plugin is better to me than the dependancy hell you get on ReactNative.

That being said - my personal usecase would like a direct C++ interop, and flutter is working on it. See https://github.com/flutter/flutter/issues/7053

Since flutter runs as native ARM they can directly call C++ instead of having an expensive JNI bridge on android. If you're wanting something fast with native processing - flutter will be the best option out there IMO if that issue is resolved.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by thosakwe on Tuesday December 04, 2018 @02:11PM (#18602683)
It seems the like the newer Dart FFI effort will benefit current users of the Dart C API, which is great news...

Dart C/C++ interop hasn't been a super-bright spot so far, and I am _beyond_ glad to see it's about to change.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by sdinsn on Tuesday December 04, 2018 @04:07PM (#18603611)
No, the relevant code for the function is ~10 lines

The rest is UI and application boilerplate

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by sebe on Tuesday December 04, 2018 @02:06PM (#18602626)
Re:Google's cross-platform Flutter UI toolkit goes 1.0 by adamtait on Friday December 14, 2018 @08:13PM (#18686373)
I came to the same conclusion (and I'm not a big company that can afford Qt), so I built my own. Before Flutter got a new team @ Google ~3 years back, it was a set of tools for building cross-platform apps with C++ shared libs. A few years ago, this is what many of the FAANG companies were doing with their apps. Then, React Native was released and (I guess) the management at Google decided to take a different tack.

I did some research and found that Dropbox open sourced their internal tool for building cross-platform mobile apps in C++. Djinni (https://github.com/dropbox/djinni) uses an interface definition language to generate bindings between C++ & ObjC & Java (via JNI). From this, I added some tooling to help get the build setup and define some basic UI elements while trying to keep it simple. If you happen to give it a try, I'd love to hear your thoughts: https://github.com/adamtait/ctheworld

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by Abishek_Muthian on Tuesday December 04, 2018 @09:53PM (#18605351)
How is the UI/UX differences between android/iOS apps handled with flutter?

e.g. iOS HID requires navigation buttons for obvious reasons & not so for android.

Re:Google's cross-platform Flutter UI toolkit goes 1.0 by JustSomeNobody on Tuesday December 04, 2018 @02:48PM (#18603015)
> We are on the verge of VR and AR and I don't see how flutter can help e.g. processing >100fps Video Feed using OpenCV library.

Use the right tool for the job. Always.

If Flutter can't handle it, it's not the right tool for the job.