I don’t usually do these kinds of posts because each framework has its pros and its cons. What works great for one team might not work for the other and what works for one project might not work for another. I put this first for people who find this post in an attempt to figure out which mobile development framework would work best for them. Take everything with a grain of salt as this review was prepared for a particular project in mind for our team. But I have tried to be as neutral as possible in presenting my points so you can figure out a good fit for your team and project.
The frameworks/approaches in question that we would be evaluating are React Native, Flutter and Kotlin. Now, if you haven’t heard about one of these before, I request you to think very seriously before choosing it because it probably might not be a good fit for you. I think I have put plenty of disclaimers, so let’s dive in.
React Native
Pros
- Reactive UI
- Live and Hot Reloading. OTA updates for production builds.
- Most of the code can be reused to port to a different platform.
- Good debugging support: https://facebook.github.io/react-native/docs/debugging
- Most network related stuff will be very simple because of availability of JS like APIs for
fetch
andWebSocket
. - GraphQL support is very good with official Apollo client.
- Good on-device database support through Realm.
- Already in use in many production apps like Instagram, AirBnb, Myntra, UberEats etc.
Cons
- No guarantees that Facebook will keep maintaining it
-
Lack of some basic features: It lacks some of the most basic features. For example, for navigation between screens, there are two possible (external) solutions:
- React Navigation: Does not use the native navigation APIs. This can be a pro as well as a con depending on the use case. The obvious con is that the navigation won’t feel as good as a native app. But it claims to be a hundred percent customizable which might or might not be required.
- React Native Navigation: Uses native navigation APIs, but has a complex setup just to get started with it (https://wix.github.io/react-native-navigation/#/docs/Installing).
- External dependencies using native APIs cannot be just
yarn add
ed as they usually require significant setup on the Java/Android side. - Although it uses native APIs, the speed is not as good.
- Availability of external packages and libraries
- Only basic Animation APIs available and animations have to be written in code
Native Development with Kotlin
Not comparing between Kotlin and Java because it is mostly like a comparison between Swift and Objective-C. Both are inter-compatible and can be mixed in an Android project. Kotlin offers a very concise syntax and has a lot of functional extras that make it almost always better than Java. Apart from small syntactic drawbacks, the only thing that might be major is that Kotlin is said to have a slower compilation time but this has mixed results which are sometimes in favor of Kotlin and sometimes for Java.
Pros
- Full power of types, OOP and null safety.
- Officially support for Android development
- Inbuilt debugging support into Android Studio
- Native look, feel and speed
- GraphQL support is very good with official Apollo client and another relatively active pure Kotlin implementation.
- Advanced layout animations can be controlled easily with layout files with automatic smooth transitions (https://developer.android.com/training/animation/videos/layout-transition.gif)
- Good dependency management with Gradle and a many community supported libraries
- Good on-device database support through Realm.
- In production on lots of apps.
Neutral
- We usually need to use external libraries for networking and object mapping. But there are very evolved options available like OkHttp and Retrofit, both maintained by Square.
Cons
- Instant Run is not as fast as you would expect.
- ActionCable support is only through an abandoned library, so the messages would probably have to be encoded manually through WebSocket.
- Android Studio is a full IDE, but it also means that it is not as smooth as other (light weight) editors like VSCode and Atom.
Flutter
Pros
- Reactive UI
- Truly cross platform. Apps written could even be used as it is on other platforms, not limited to mobile.
- Hot reload, changes on code can be deployed within a second.
- Dart provides full typed support.
- Flutter is compiled to native ARM code so it is theoretically supposed to be very fast.
- Very good animation support.
Neutral
- Debugging support through Observatory (https://dart-lang.github.io/observatory/) which is a different tool and will have a slight learning curve.
- Good support for networking and websocket. No Actioncable implementation. GraphQL is not officially supported, but there is an external plugin for it.
- Not a very big catalog of big apps being used in production.
Cons
- Essentially only a UI kit. Has a good collection of components (https://flutter.io/docs/development/ui/widgets) to mimic native views and beatiful material widgets, but in the end, everything is drawn using their own engine
- Dart is a relatively new language and although expressive, will have a slight learning curve for new development.
- Maintained by Google without any guarantees of continued support.
- Very early stage community, documentation/help and libraries.
- Only basic key-value support through
shared-preferences
plugin.sqllite
is supported (through another plugin) for on-device database, but it is not as easy as a full fledged DB API like Realm.