官网 推荐的是
IDE | 语言 |
---|---|
Android Studio | Kotlin/Java |
Flutter v/s Native: Will Flutter Replace Native Android App Development?
We’ll compare Flutter and native Android development on the basis of 5 criteria:
Technical Architecture
The tech stacks used for Google Flutter and Native Android development are different. Both the platforms have completely different architecture.
While Dart is the programming language of Flutter, Java or Kotlin is the language for native Android development.
Flutter provides you with more Integrated Development Environment (IDE) options.
Native Android app development uses just Android Studio as the IDE.
However, in addition to Android Studio, Flutter enables you to use many other lightweight editors such as VIM, Atom, and Sublime Text.
You can create Flutter apps in an IDE such as IntelliJ Idea.
The apps created on native Android are slick and fast. This is because they are created natively with the help of either Kotlin or Java language.
The guide of native Android Developers explains the Android app development’s entire ecosystem.
The GitHub Wiki clearly explains the Flutter engine’s architecture. However, to explain it in short, everything that you need for developing a native app, you will find in the Flutter engine itself.
Productivity of Developers
Android engineers use Android Studio, native build, and Android Studio’s platform tools for developing apps natively. A slow process is involved whenever an app developer makes any change and wants to see the desired result. You may have to use an Android Virtual device or emulator for viewing the changes done by you while building the app. The process is slow because it can take a lot of time for Gradle builds.
This slow process experienced by the Android developers has been done away with in Flutter app development. Google has incorporated a feature called “hot reload”, which helps developers to instantly view the effect of changes made in the app. However, this feature may not remain as effective when the app you have created grows in size. Therefore, developers must adopt new techniques for effectively using this feature.
Gradle handles the dependency management for native Android applications. You’ll find loads of Kotlin and Java packages in the market. Android ecosystem is efficient enough to handle these packages effectively. The Pub Package manager built within the Flutter apps, helps you get new dependencies for development.
When it comes to the programming language, native Android development is ahead of Flutter, thus indicating that in the war of Flutter v/s Native, Native is the clear winner.
- Dart is a relatively new language in comparison to Java, the language used to develop apps in the Native Android ecosystem. While Dart was released in 2011, Java in 1991. Dart is still evolving and therefore lacks support for many text editors and IDEs. As a developer, you have to scale a steep learning curve to learn the new language.
- Native languages such as Kotlin and Java are more friendly with Android Studio. While Kotlin is a type-safe language, Java is there for a long period of time. That’s why you will get lots of community support for these native languages.
UI Components
Native Android
A lot of time is given by the front-end developers in designing the User Interface. To build UI, Google has provided lots of components for native app development. They are not only powerful but also well documented.
You, as an app developer, can also use Android Studio’s interface builder to build the UI faster by using the tools of native development. You’ll find all relevant basic information for building elements of UI in the Android UI docs.
Flutter
The Flutter UI engine works differently. It is the rendering engine and frameworks that run Flutter apps. Complex UIs can be built by using the concept of widgets on Flutter.
The Flutter user interface includes a tree of all kinds of widgets (be in the stateful or stateless widget). You can check the catalog for building complex UIs that support Cupertino for iOS, on one hand, and Material Components for Android, on the other. Both the layout and widgets at Flutter app development are pixel perfect.
Testing Support
Native Android
You’ll get amazing testing support for native Android tools. As an app developer, you can test native apps easily. You can do it either from Android Studio or by using Gradle from the command line. Whether it is unit, integration, instrumented, and tests for the user interface, you can add them for Android applications.
For lower-level testing, you’ll get frameworks of both Java and Kotlin for lower-level testing. The Espresso framework supports UI testing. You can use the Mockito framework for mocking things and you’ll get lots of painless support in the process.
Flutter
You can write tests at the unit, functional, and User Interface level, thanks to the solid testing framework provided by Google Flutter.
It provides you with a cool feature called Widget Testing. It helps you to run tests for the user interface as fast as unit tests. Flutter provides you with detailed documentation, which makes it easier for you to know how it is possible to test apps with the help of Flutter.
The integration tests at Flutter are very similar to that of Xcode UI tests. They go through the user interface for performing specific operations. The best thing about Flutter integration tests is that they run in a separate process. You can run them on:
- Simulators
- Emulators
- Real Devices
To drive these tests, Flutter provides you with a Flutter Driver. It provides you with a separate package.
CI/CD Support
Native Android
One of the greatest aspects of Android apps is that it helps you in faster and continuous building and delivery practices.
However, when it comes to the native Android app’s building and publishing process outside the Integrated Development Environment, it is a bit complex. Though there is strong support for automation building, automation testing, and Android Studio publishing at native Android apps, no dedicated CI/CD platform is provided for Android by Google.
The app developers of native Android have to rely on 3rd party CI servers such as TeamCity and Jenkins or mobile CI services such as Nevercode, Circle CI, Travis CI, and many more. As you can develop native Android apps on Linux, it becomes easier on Android to manage the CI/CD aspects in comparison to iOS applications.
Flutter
The team of Flutter at Google has entered into a partnership with Nevercode. This partnership has helped them provide their app developers with a Codemagic CI/CD solution. It is a painless solution for automatically detecting, building, testing, and packaging the Flutter application with zero configuration. You can build, test, and deploy Flutter apps to the Play Store easily with Codemagic.