Flutter vs. React Native – What to Choose in 2020?

Do you want to develop apps more quickly? And to reduce costs with cross-platform development – but you’re not sure which technology to choose?

In this article, we compare the leading market players – Flutter and React Native – from the app owners’ perspective to help you identify which framework best fits your app idea.

Flutter vs React Native 2019

What you’ll find in this article

Why we created this article

Cross-platform solutions are gaining popularity. Flutter and React Native are the two leading market players, but at Droids On Roids, we’ll build commercial apps for partners using the approach that best fits the solution – be it native, Flutter, or React Native.

Still, business owners always want to know the answer to several critical questions:

  • Which framework best fits my project?
  • Which solution can provide the fastest time-to-market for my app?
  • Will my app be stable and user-friendly?
  • Which solution is best if perfect design is my #1 priority?

We wrote this article to summarize the answers we share with our partners so that you can benefit from them, too.

We hope it helps you make a smart, conscious decision when it comes to choosing the best cross-platform solution for your app idea.

Who wrote the article?

It takes a certain level of experience to write about Flutter and React Native in sufficient depth – and to compare and contrast the two technologies.

As such, we asked two Droids On Roids developers to take on the task:

  • Bartosz – Web & React Native Developer
  • Damian – iOS & Flutter Developer

These two build commercial apps for clients in Flutter and React Native every day. So, you can be sure the knowledge they’re about to share includes not only the theory but years of development experience as well.

We have also tested our understanding against popular articles in the developer community, referencing these sources to answer any questions. You can find a full list of their references at the end of this post.

Flutter vs. React Native: In a nutshell

  Flutter React Native
What is it? A portable UI toolkit for building natively-compiled apps across mobile, web, and desktop* from a single codebase A framework for building native applications using React
Official release December 2018, Google I/O March 2015, F8 Conference
Created by Google Facebook
Free and open source Yes Yes
Programming language Dart JavaScript
Popularity 81,200 Stars on Github (December 2019) 83,200 stars on Github (December 2019)
Hot Reload Yes Yes
Native performance Great Great
UI Flutter apps look as good on the up-to-date operating systems as they do on older versions.

 

Since they only have one codebase, the apps look and behave similarly across iOS and Android – but thanks to Material Design and Cupertino widgets, they can also imitate the platform design itself. How’s that possible?

Flutter contains two sets of widgets which conform to specific design languages: Material Design widgets implement Google’s design language of the same name; Cupertino widgets imitate Apple’s iOS design.

This means that your Flutter app will look and behave naturally on each platform, imitating their native components. 

Application components look just like native ones (e.g. a button on an iOS device looks just like a native iOS button, and the same on Android).

 

The fact React Native uses native components under the hood should give you confidence that, after any OS UI update, your app’s components will be instantly upgraded as well.

That said, this can break the app’s UI but it happens very rarely.

If you want your app to look near-identical across platforms – as well as on older versions of an operating system (as Flutter achieves) – then consider using third-party libraries (like this one). They will enable you to use Material Design components, in place of native ones.

Sharing code Currently on iOS and Android – but the long-term vision for Flutter is to offer an integrated solution that allows developers to write one code for both desktop & mobile, and for the web.

 

Flutter for Web support is available as a tech preview but still, this isn’t an alpha channel yet.

When it comes to developing desktop apps with Flutter, APIs are in their early stages of development and so will be probably released, just further down the line.

iOS and Android – but there are select libraries that allow you to use the same code to build iOS, Android, web, and Windows10 apps.

 

You can also extract shared code in mobile, desktop, and web apps, to a separate repository; treat it as a separate project; then inject it in the same way as another dependency.

This allows a developer to focus on writing code for a specific platform without having to consider compatibility with another one.

Top apps made with this technology Xianyu app by Alibaba, Hamilton app for Hamilton Musical, Google Ads app Instagram, Facebook, Facebook Ads, Skype, Tesla
Time-to-market Typically much faster than native development. Possibly as fast as development with Flutter.

 

However…

React Native uses bridge and native elements, so it may require separate optimization for each platform – a problem that widget-based Flutter doesn’t run into. It may make the app development with React Native longer.

Competitive advantage
  • Great look and feel thanks to rich widgets;
  • Rapidly growing community, and popularity;
  • Excellent documentation with strong support from the Flutter team (which makes it easy to start developing with Flutter);
  • Improving Flutter for Web, offering the potential for one codebase across mobile and web platforms
  • Difficult to beat time-to-market length
  • Stability (5+ years on the market);
  • Many successful, prominent market players using React Native;
  • Mature, vast community;
  • Easy-to-learn technology;
  • Plenty of tutorials and libraries, which allow quick and easy development;
  • Code can be easily reused for both web app and desktop app development.
When it is not the best fit If…

 

• Your app needs to support 3D Touch (for now, Flutter doesn’t support 3D – but it features on the Flutter team’s long-term roadmap)

• The design of your app is platform-specific

• Your app requires multiple interactions with an OS; or requires rare, little-known native libraries

• You need a minimalistic UI, but rely on significant use of the phone hardware (e.g. an application that plays music, or only takes pictures)

• You want to create an instant app (small-sized app)

If your app sounds like any of the above, it’s probably better you choose native app development.

Read more about these cases here >>

If…

 

• Your app needs to handle less common, or ultra-specific tasks (like calculations) in the background

• You require custom communication via Bluetooth (which can be tricky to implement using React Native)

• You want to create an app for Android only

In truth, if you want to build an iOS app and you know JavaScript, consider React Native – but if you want an Android-only app, it’s likely better to build natively with another team. Why? Right now, iOS has better support than Android.

If your app sounds like any of the above, it’s probably better you consider choosing native app development.

Introduction to Flutter and React Native

First, let’s cover the basic (yet essential) details about Flutter and React Native.

What is Flutter?

Flutter is a portable UI toolkit. In other words, it’s a comprehensive app Software Development Kit (SDK), complete with widgets and tools.

What’s Flutter for?

Flutter enables cross-platform app development.

It gives developers an easy way to build and deploy visually attractive, natively-compiled applications for mobile (iOS, Android), web, and desktop – all using a single codebase (source: official Flutter website).

* Please note:

  • When it comes to developing desktop apps with Flutter, the API is still in the development stage. Google is working on extending Flutter to support desktop as a target environment, allowing developers to create macOS, Windows, and Linux applications with the technology.

In the long run, this effort will lead to a fully integrated solution where developers can create apps for desktop platforms as they do for mobile platforms – at the time of writing, however, the solution is in development (source).

  • Flutter for Web is currently available as a technical preview only. Flutter for Web is a code-compatible implementation of Flutter that allows you to compile existing Flutter code written in Dart into a client experience that can be embedded in the browser and deployed to any web server. You can use all the features of Flutter, and you don’t need a browser plug-in (source).

A little more about Flutter…

  • It’s free and open source
  • It’s based on Dart – a fast, object-oriented programming language (Google released Dart 2.3 with new support for UI-as-code features – note that Dart is now in its 2.6 version). Dart is relatively new, and is easy to learn – especially for experienced developers more familiar with Java and C#
  • The architecture is based on the very popular reactive programming (it follows the same style as React)
  • It provides its own widgets, drawn from its own high-performance rendering engine – these are fast, attractive and customizable
  • Thanks to the widget experience, Flutter apps have a great look and feel (while you can still create your own custom app design using readily-available UI elements that follow specific platform guidelines)

Who created Flutter?

A team at Google built Flutter.

But as an open-source project, both Google and the Flutter community contribute to its development.

How mature is Flutter?

A brief history of Flutter:

  • February 2018, Mobile World Congress – First beta release of Flutter
  • April 2018, Google I/O – Flutter beta 2 release
  • May 2018, Google I/O – Flutter beta 3 release
    • Flutter joins GitHub’s top 100 repos
  • June 2018 – Flutter Preview 1 release
  • September 2018 – Flutter Preview 2 release
  • November 2018 — Dart 2.1 release
  • December 2018, Google I/O – Flutter 1.0 release
    • A crucial milestone for the technology – since Dec. 2018, Flutter has been considered as stable and ready for production
  • February 2019, Mobile World Congress – Flutter 1.2 release
  • May 2019, Mobile World Congress:
  • July 2019, Flutter 1.7 release
  • September 2019, Flutter 1.9 release

As you can see, Google shifted from the Flutter beta version to the final stages of stabilization for Flutter 1.0 at a rapid pace.

Better still, since the release of Flutter 1.0, the team hasn’t rested on its laurels. It has actively worked on making the toolkit stronger and more resilient – prioritizing enhanced stability, performance, and quality.

Moreover, Flutter 1.5 includes hundreds of changes in response to developer feedback (source).

Flutter is now one of the top 20 active software repositories on GitHub (16th place as of December 11, 2019), which proves the developer community uses it and continues to contribute to its improvement.

In summary, Flutter remains fledgling technology.

Yet, given the pace of Flutter’s improvements – and its explosive popularity – we can say with confidence that it’s impressively stable and mature for its age.

And judging by the rate of development, we expect to see Flutter for Web become stable within 12-months, as well.

What popular apps are made with Flutter?

For more examples of top Flutter apps, read this article > Top Apps Made with Flutter – 17 Stories by Developers and Business Owners


What is React Native?

React Native is an open-source mobile application framework that uses JavaScript.

What is React Native for?

React Native is an effective framework for:

  • Cross-platform development
  • Building mobile apps using JavaScript language
  • Developing applications for both Android and iOS using a single codebase
  • Using the same design as React

* Please note:

  • Apps created using React Native are not mobile web apps. React Native uses the same fundamental UI building blocks as regular iOS and Android apps: this means that instead of building in Java, Kotlin, or Swift – you’re putting the same building blocks together, using JavaScript and React (source).
  • React Native uses components that are analogous to widgets in Flutter.

To develop web and desktop applications with React Native, it’s best to use external libraries (as detailed in this paragraph).

Who created React Native?

Facebook created React Native.

How mature is React Native?

A brief history of React Native:

  • Summer 2013, Facebook hackathon – React Native started as an internal Facebook project
  • January 2015, React.js Conference – React Native 1 Preview release
  • March 2015, F8 Conference – Official Launch of React Native
    • Facebook declares React Native, ‘open for use and available on Github’

Looking at the above, two things are for certain: React Native is older than Flutter, and it boasts a bigger community. Not to mention the fact that the Facebook team has had plenty of time to stabilize the API as well as focus on fixing any underlying issues.

And let’s not forget – Facebook is working on several other notable enhancements as well:

  • Lean Core – reducing an app’s size by moving optional components/features to separate repositories (to add to an app as/when needed)
  • TurboModules – for improved handling of native modules
  • React Native Fabric – re-architected UI layer

 

ref: https://www.thedroidsonroids.com/blog/flutter-vs-react-native-what-to-choose-in-2020

Viết ứng dụng Android với Flutter và Dart

Final product image
What You'll Be Creating

Nếu bạn đang tìm kiếm các phương pháp thay thế để phát triển ứng dụng Android, bạn nên cân nhắc thử Flutter của Google, một framework dựa trên ngôn ngữ lập trình Dart.

Các ứng dụng được xây dựng với Flutter hầu như không thể phân biệt với những ứng dụng được xây dựng bằng cách sử dụng Android SDK, cả về giao diện và hiệu suất. Hơn nữa, với những tinh chỉnh nhỏ, chúng có thể chạy trên thiết bị iOS.

Trong hướng dẫn này, tôi sẽ giới thiệu đến bạn các khái niệm cơ bản của Flutter bằng cách chỉ cho bạn cách làm thế nào để xây dựng một ứng dụng tính tiền bo đơn giản cho Android.

Để có thể thực hiện theo hướng dẫn này, bạn sẽ cần:

  • phiên bản mới nhất của IntelliJ IDEA
  • Studio Android 2.2 hoặc cao hơn
  • một thiết bị hoặc emulator chạy Android 4.4 hoặc cao hơn
  • máy tính chạy Mac hoặc Linux

Chạy ở 60 fps, giao diện người dùng được tạo ra với Flutter thực thi tốt hơn nhiều so với những ứng dụng được tạo ra với các framework phát triển đa nền tảng khác chẳng hạn như React Native và Ionic. Nếu điều đó không kích thích bạn, thì đây là một vài lý do khác tại sao bạn có thể muốn sử dụng Flutter:

  1. Flutter sử dụng Dart, một ngôn ngữ nhanh, hướng đối tượng với nhiều tính năng hữu ích như mixin, generic, isolate, và static type.
  2. Flutter có các thành phần UI của riêng nó, cùng với một cơ chế để kết xuất chúng trên nền tảng Android và iOS. Hầu hết các thành phần giao diện người dùng, đều sẵn dùng, phù hợp với các nguyên tắc của Material Design.
  3. Các ứng dụng Flutter có thể được phát triển bằng cách sử dụng IntelliJ IDEA, một IDE rất giống với Android Studio.
Advertisement

Bạn có thể có được phiên bản mới nhất của Flutter bằng cách nhân bản kho lưu trữ của nó trên GitHub.

1
git clone https://github.com/flutter/flutter.git

Flutter có một số phụ thuộc, chẳng hạn như Dart SDK và các phông chữ Material Design. May mắn thay, lần đầu tiên bạn chạy công cụ chẩn đoán của Flutter, tất cả chúng đều được cài đặt tự động.

1
2
cd flutter/bin
./flutter doctor
Logs of Flutters diagnostic tool

Để có thể xây dựng các ứng dụng Android, bạn cũng phải trỏ Flutter đến thư mục nơi bạn cài đặt Android Studio.

1
./flutter config --android-studio-dir ~/android-studio

Mặc dù bạn có thể trực tiếp sử dụng CLI của Flutter để tạo và chạy các ứng dụng mới, nhưng bạn sẽ có một trải nghiệm phát triển tốt hơn nếu bạn sử dụng một IDE. IDE được khuyến khích cho Flutter là IntelliJ IDEA.

Tuy nhiên, trước khi bạn bắt đầu phát triển các ứng dụng Flutter với nó, bạn phải cài đặt các plugin cho Dart và Flutter. Để làm như vậy, hãy bắt đầu bằng cách chọn Configure > Plugins trong màn hình chào mừng của IntelliJ.

The Configure menu

Trong hộp thoại bật lên, hãy bấm nút Browse repositories... và tìm kiếm plugin Dart. Một khi bạn tìm thấy nó, hãy bấm nút Install để cài đặt nó.

Dart plugin dialog

Tương tự như vậy, tìm kiếm và cài đặt plugin Flutter.

Flutter plugin dialog

Một khi cả hai plugin được cài đặt, hãy khởi động lại IntelliJ IDEA.

Bây giờ, bạn phải trỏ plugin Flutter đến thư mục mà bạn đã cài đặt Flutter. Để làm như vậy, hãy chọn Configure > Settings trong màn hình chào mừng và trong hộp thoại bật lên, điều hướng đến Languages & Frameworks > Flutter. Trong trường Flutter SDK path, gõ đường dẫn tuyệt đối của thư mục.

Flutter plugin configuration dialog

Nhấn OK để hoàn tất cấu hình.

Để tạo ra một dự án Flutter mới, bấm nút Create New Project ở màn hình chào mừng. Trong hộp thoại New Project, chọn Flutter và nhấn Next.

Bây giờ, bạn có thể cung cấp một cái tên có ý nghĩa cho dự án của bạn và nhấn Finish.

New project dialog

Một khi dự án đã được tạo ra, tôi đề nghị bạn nhấn nút Run để đảm bảo rằng Dart SDK, các plugin và framework Flutter tất cả được cấu hình một cách chính xác. Nếu mọi thứ đều ổn, sau một vài giây, bạn sẽ thấy màn hình sau đây trên thiết bị hoặc emulator:

Flutter demo app

Lưu ý rằng, từ thời điểm này về sau, bạn không cần phải bấm lại nút Run ngay cả sau khi thực hiện thay đổi code. Flutter hỗ trợ hot reload (tải lại nóng), một tính năng cho phép bạn ngay lập tức đẩy các bản cập nhật cho ứng dụng mà không cần khởi động lại nó.

Hot Reload App button

Trong hướng dẫn này, chúng ta sẽ tạo ra một ứng dụng tính tiền bo với các thành phần sau:

  • một TextField để chấp nhận một hóa đơn
  • một TextField để chấp nhận một tỷ lệ phần trăm tiền bo
  • một RaisedButton mà người dùng có thể bấm để tính toán tiền bo

Mỗi thành phần của Flutter có thể là một StatelessWidget hoặc một StatefulWidget. Như tên gọi của nó, một StatefulWidget có một đối tượng State liên kết với nó, cho phép nó không chỉ lưu trữ dữ liệu, mà còn để phản ứng với những thay đổi trong dữ liệu.

Một StatelessWidget, mặt khác, là một đối tượng đơn giản, không được thiết kế để lưu trữ cố định bất kỳ dữ liệu nào. Để hướng dẫn này được ngắn gọn, chúng ta sẽ tạo ra ứng dụng tính tiền bo như là một StatelessWidget. Do đó, mở main.dart, loại bỏ tất cả các nội dung của nó, và thêm code sau đây:

1
2
3
4
5
import 'package:flutter/material.dart';
 
class TipCalculator extends StatelessWidget {
 
}

Trong đoạn code ở trên, dòng import là quan trọng bởi vì material.dart là thư viện có chứa tất cả các thành phần Material Design mà chúng ta sẽ sử dụng trong ứng dụng này.

Để lưu trữ hóa đơn và phần trăm tiền bo, thêm hai biến thành viên vào lớp.

1
2
double billAmount = 0.0;
double tipPercentage = 0.0;

Để bắt đầu tạo ra giao diện người dùng của ứng dụng, hãy override phương thức build().

1
2
3
4
@override
Widget build(BuildContext context) {
    // More code goes here
}

Hãy để chúng tôi tạo ra hai thành phần TextField. Trong lúc làm như vậy, chúng ta có thể chỉ rõ các chi tiết chẳng hạn như nhãn mà chúng ta muốn kết hợp với các thành phần và kiểu của bàn phím ảo được hiển thị khi chúng ở trong trạng thái tập trung.

Bởi vì chúng ta không thể truy xuất trực tiếp nội dung của một thành phần TextField, nên chúng ta cũng phải kết hợp một trình xử lý sự kiện onChanged với nó. Bên trong trình xử lý, trong đó nhận được một đối tượng InputValue, chúng ta có thể cập nhật nội dung của các các biến thành viên của lớp.

Theo đó, thêm code sau đây bên trong phương thức build():

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Create first input field
TextField billAmountField = new TextField(
  labelText: "Bill amount(\$)",
  keyboardType: TextInputType.number,
  onChanged: (InputValue value) {
    try {
      billAmount = double.parse(value.text);
    } catch (exception) {
      billAmount = 0.0;
    }
  }
);
 
// Create another input field
TextField tipPercentageField = new TextField(
  labelText: "Tip %",
  keyboardType: TextInputType.number,
  hintText: "15",
  onChanged: (InputValue value) {
    try {
      tipPercentage = double.parse(value.text);
    } catch (exception) {
      tipPercentage = 0.0;
    }
  }
);

Ngay cả khi bạn chưa bao giờ làm việc với Dart trước đây, thì đoạn code ở trên cũng khá trực quan, miễn là bạn quen với Java. Ví dụ, bạn có thể thấy rằng chúng ta đang sử dụng phương thức parse() để chuyển đổi mỗi nội dung văn bản của TextField thành một đối tượng double. Vì phương thức parse() có thể sinh ra một FormatException, nó cũng được bao quanh bởi một khối try...catch.

Tạo ra một thành phần RaisedButton giống như việc tạo ra một TextField. Tuy nhiên, để gán nhãn cho nó, bạn phải tạo ra một thành phần Text mới và thêm vào như là child (con) của nó.

1
2
3
4
5
6
7
// Create button
RaisedButton calculateButton = new RaisedButton(
    child: new Text("Calculate"),
    onPressed: () {
        // More code goes here
    }
);

Bên trong trình xử lý sự kiện onPressed của button, chúng ta sẽ tính toán tiền bo và tổng số tiền phải thanh toán, và hiển thị cả hai bên trong một hộp thoại. Để tạo hộp thoại, chúng ta có thể sử dụng lớp AlertDialog. Sau khi được tạo ra, hộp thoại có thể được hiển thị bằng cách truyền nó như là đối số vào phương thức showDialog().

Theo đó, thêm code sau đây vào trình xử lý sự kiện onPressed:

01
02
03
04
05
06
07
08
09
10
11
12
// Calculate tip and total
double calculatedTip = billAmount * tipPercentage / 100.0;
double total = billAmount + calculatedTip;
 
// Generate dialog
AlertDialog dialog = new AlertDialog(
content: new Text("Tip: \$$calculatedTip \n"
    "Total: \$$total")
);
 
// Show dialog
showDialog(context: context, child: dialog);

Trong đoạn code ở trên, lưu ý rằng chúng ta đã sử dụng tính năng nội suy chuỗi của Dart để nhúng các biến bên trong content (nội dung) của hộp thoại. Ngoài ra, bạn có thể thấy rằng chuỗi trong Dart có thể được nối chỉ bằng cách đặt chúng bên cạnh nhau—tuy vậy bạn cũng có thể sử dụng toán tử +, nếu bạn muốn.

Một ứng dụng Flutter thường không có gì khác ngoài một cây của các thành phần. Nói cách khác, bạn tạo một ứng dụng Flutter chỉ bằng cách đơn giản là tạo ra nhiều thành phần và thiết lập mối quan hệ cha-con giữa chúng.

Hiện tại, không có mối quan hệ giữa các thành phần mà chúng ta đã tạo ra trong bước trước. Như bạn có thể thấy, tất cả chúng sẽ là anh chị em, vì vậy bây giờ hãy tạo ra một thành phần cha cho chúng.

Một thành phần có thể có nhiều con thường được gọi là một thành phần layout. Flutter cung cấp một số thành phần layout để bạn lựa chọn. Đối với ứng dụng của chúng ta, thành phần Column (Cột) là phù hợp nhất vì nó đặt tất cả các con của nó từng cái một lên trên nhau.

Ngoài ra, để phù hợp với đặc tả Material Design, chúng ta phải thêm một padding 16 dp vào thành phần Column. Chúng ta có thể làm như vậy bằng cách thành child (con) của một thành phần Container

1
2
3
4
5
6
7
8
Container container = new Container(
  padding: const EdgeInsets.all(16.0),
  child: new Column(
    children: [ billAmountField,
                tipPercentageField,
                calculateButton ]
  )
);

Giao diện người dùng Material Design không hoàn thiện mà không có một thanh ứng dụng. Vì vậy, hãy tạo một cái ngay bây giờ bằng cách sử dụng thành phần AppBar.

1
AppBar appBar = new AppBar(title: new Text("Tip Calculator"));

Các layout có chứa thanh ứng dụng và container là rất phổ biến và Flutter cung cấp một thành phần Scaffold để giúp bạn nhanh chóng thiết lập một mối quan hệ giữa chúng.

1
2
Scaffold scaffold = new Scaffold(appBar: appBar,
                                 body: container);

Với thành phần Scaffold tại gốc của nó, cây thành phần của chúng ta đã sẵn sàng. Bạn có thể sử dụng thành phần Scaffold như là giá trị trả về của phương thức build().

1
return scaffold;

Nếu bạn đang cảm thấy khó để hình dung cái cây, thì sơ đồ sau đây sẽ giúp bạn:

Diagram of the widget tree

Tập tin Dart của chúng ta cần một hàm main() như là khởi điểm của nó. Bên trong nó, chúng ta phải gọi hàm runApp() để thật sự inflate và kết xuất cây thành phần mà chúng ta đã tạo trong bước trước.

Ngoài ra, thành phần TipCalculator của chúng ta phải được đặt bên trong một thành phần MaterialApp để một theme Material Design và bảng màu có thể được áp dụng cho nó. Vì vậy, hãy thêm code sau đây vào main.dart:

1
2
3
4
5
6
void main() {
  runApp(new MaterialApp(
    title: 'Tip Calculator',
    home: new TipCalculator()
  ));
}

Bây giờ, bạn có thể nhấn nút Hot Reload App (trực tiếp tải lại ứng dụng) để bắt đầu sử dụng ứng dụng trên thiết bị của bạn.

Tip calculator app

Trong hướng dẫn này, bạn đã biết cách để sử dụng Flutter và Dart, cùng với IntelliJ IDEA, để tạo ra một ứng dụng đơn giản cho Android.

Theo tôi, Flutter có hầu như tất cả mọi thứ mà một nhà phát triển tìm kiếm đối với một framework phát triển ứng dụng di động đa nền tảng. Tuy nhiên, trước khi bạn quyết định bắt đầu xây dựng ứng dụng tiếp theo của bạn với nó, lưu ý rằng nó vẫn còn là một framework rất mới và đang phát triển nhanh chóng.

Để tìm hiểu thêm về Flutter, bạn có thể tham khảo tài liệu chính thức của nó.

https://code.tutsplus.com/vi/tutorials/developing-an-android-app-with-flutter--cms-28270

Parallel processing: Setup Hadoop for multi-node cluster - MapReduce on Eclipse

- Reference Link:

(Ubuntu)

https://medium.com/@jootorres_11979/how-to-set-up-a-hadoop-3-2-1-multi-node-cluster-on-ubuntu-18-04-2-nodes-567ca44a3b12 

https://www.linode.com/docs/databases/hadoop/how-to-install-and-set-up-hadoop-cluster/

(Windows)

https://gist.github.com/addingama/f665914340ec26f7efa80e86f53622e1 

(MapReduce on Eclipse)

https://www.shabdar.org/hadoop-java/138-how-to-create-and-run-eclipse-project-with-a-mapreduce-sample.html

http://users.encs.concordia.ca/~moa_ali/Comp6521Lab/preparing_hadoop_in_eclipse_luna/

(download)

https://archive.apache.org/dist/hadoop/core/

 

Note of Lab:

/usr/local/hadoop/share/Hadoop/mapreduce
/usr/local/hadoop/share/hadoop/common/lib

 

Prepare
>> hdfs namenode –format

 


Running
Run it as an Administrator
>> cd C:\hadoop-2.10.0\sbin
>> start-all.cmd

Make sure these apps are running
Hadoop Namenode
Hadoop datanode
YARN Resourc Manager
YARN Node Manager

>> localhost:8088 to open Resource Manager
>> localhost:8042 to open Node Manager
>> localhost:50070 to checkout the health of Name Node
>> localhost:50075 to checkout Data Node

 

 

export HADOOP_CLASSPATH=$(hadoop classpath)
echo $HADOOP_CLASSPATH 
hadoop fs -mkdir /WordCountTutorial
hadoop fs -mkdir /WordCountTutorial/Input
hadoop fs -put '/home/osboxes/Desktop/WordCountTutorial/input_data/input.txt' /WordCountTutorial/Input
cd /home/osboxes/Desktop/WordCountTutorial/
>> Tạo file jar
hadoop jar '/home/osboxes/Desktop/WordCountTutorial/WordCount.jar' WordCount /WordCountTutorial/Input /WordCountTutorial/Output

 


export HADOOP_CLASSPATH=$(hadoop classpath)
echo $HADOOP_CLASSPATH 
hadoop fs -mkdir /MatrixMultiply
hadoop fs -mkdir /MatrixMultiply/Input
hadoop fs -put '/home/osboxes/Desktop/MatrixMultiply/input_data/M' /MatrixMultiply/Input
hadoop fs -put '/home/osboxes/Desktop/MatrixMultiply/input_data/N' /MatrixMultiply/Input
cd /home/osboxes/Desktop/MatrixMultiply/
>> Tao file jar
hadoop jar '/home/osboxes/Desktop/MatrixMultiply/MatrixMultiply.jar' /MatrixMultiply/Input /MatrixMultiply/Output


Xóa file: 
hadoop fs -rm -R /MatrixMultiply/Input/M.txt
hadoop fs -rm -R /MatrixMultiply/Output/_temporary

Khởi tạo lại kết nối SSH:
ssh-keygen -t rsa
ssh-copy-id hadoopuser@hadoop-master
ssh-copy-id hadoopuser@hadoop-slave1
ssh-copy-id hadoopuser@hadoop-slave2