Eshiet Ekemini A graduate of University of Uyo and a tech enthusiast. Ekemini has been building for mobile for two years, with particular focus on Kotlin and Flutter.

Kotlin vs. Flutter: A guide

6 min read 1882

flutter kotlin mobile development

Today, there has been major explosions in the tech ecosystem — the global mobile application market share, according to Allied Market research, is projected to hit $407.7 Billion in 2026.

This leaves a major battleground for dominance in the tools and frameworks used for creating mobile applications.

In this article, we’ll explore two of the most popular frameworks and programming languages for creating mobile applications, while comparing and contrasting what makes them a better choice for developing your next mobile application.

What is Flutter?

According to the official Flutter pages, Flutter is Google’s portable UI toolkit for crafting stylish, natively compiled mobile, web, and desktop apps from a single codebase.

Flutter operates with existing code and is freely and openly used by developers and organizations worldwide.

Flutter was first acquired by Google in 2013 and had already started to work with technology giants as a gesture recognition software at Y-Combinator’s group of companies in 2012. Flutter is fundamentally a free, open-source platform for the development of applications with a native feel for Android and iOS, all from one codebase.

A brief history of Flutter

The very first official version of Flutter was announced at the Dart Developer summit in 2015 and was codenamed “Sky,” which was said to run at 120 frames per second on Android OS. At the Mobile World Congress, the first beta version of Flutter was released in February 2018.

The second Flutter beta and first stable version were also released at the Google IO in April the same year. Subsequently, Flutter has had several upgrades and the latest version on the stable channel is version 1.22.5 which was released in November of 2020.

What programming languages does Flutter use?

C++, C, Dart, and Skia Graphics Engine are the programming languages that Flutter uses. Flutter has recently been a major player in the production of mobile applications, despite having an infant ecosystem and being a new technology.

Current use of Flutter

Although Flutter is barely well established, mega organizations such as Alibaba (one of the leading B2B marketplaces online) and Tencent, which has a record for the largest Chinese online community, have already adopted the technology.

We made a custom demo for .
No really. Click here to check it out.

The functionality of Google Ads also uses Flutter. Google is also making use of Flutter architecture to build its much anticipated future OS, Fuchsia.

What is Kotlin?

Kotlin is a programming language that is free, static, open-source, and primarily created for use on Android and JVM with features of both OOP and Functional Programming Language. Some of Kotlin’s top features are:

  • Interoperability
  • Safety
  • Tools and Support

Since the inception of Android, the officially programming languages were the famous Java and C++ in some cases. But at Google IO 2017, Google announced their support for Kotlin as the official Android programming language and integrated Kotlin support directly into Android studio. This enabled developers to convert previous Java codes into Kotlin and also run Kotlin and Java code side-by-side in their projects.

Flutter vs. Kotlin: Development trends, statistics, and adoption

Although the statistics don’t show a huge distinction, GitHub ranked Kotlin as number 16 — and 15 when it comes to programming languages on GitHub with the highest number of PRs in the first and second quarter of 2020. There have since been a significant amount of feature improvements in the framework performance, as well as many collaborative efforts in the Flutter community.

Based on GitHub stars and forks, Kotlin has 35k stars and 4k forks, while Flutter leads with 111k stars and 15k forks.

In addition, when Flutter version 1.20 was released in August 2020, Google reported that earlier in April, up to 50,000 Flutter apps had been uploaded to the play store with an apex rate of 10,000 new apps per month. Roughly three months after that, there were more than 90,000 Flutter apps, indicating nearly an 80% spike in growth and increase.

Even if Kotlin has more applications on the Google play store, the momentum and adoption of Flutter are really much higher when compared to its Kotlin counterpart for mobile application development.

And, according to the Flutter showcase website, several major companies have ported their codebase from Kotlin to Flutter. Some of these companies include Realtor, Tencent, The New York Times, Google Assistant, and Square.

Comparing Flutter and Kotlin

Here’s a brief comparison between Flutter and Kotlin.

Language and syntax

When it comes to the language syntax, Kotlin and Dart are more similar in some ways. Although Kotlin does not make use of semicolons and Dart does, both languages work the same way when it comes to writing comments and handling white spaces. Also, both Dart and Kotlin are Object-Oriented Programming Languages.

Performance

Both Kotlin and Flutter have their performance pros and cons. One of the most remarkable features of Flutter is the hot reload and hot restart feature, which gives developers the ability to make changes to their code and see the user interface changes instantly, speeding up development time frames and makes it easier to build applications.

Kotlin, on the other hand, provides more access to native features and components like camera, Bluetooth, etc., whereas in Flutter, these are achieved using libraries that are written in the native languages like Kotlin, Java, Swift, or objective C.

Community support

Both Kotlin and Flutter have great community participation. But judging by the newness of the Flutter framework, and in contrast to Kotlin, it has more active membership participation and growing popularity. The Flutter documentation is also extremely detailed and up to date. It’s a great place for anyone without prior knowledge of the framework to start with, as it provides information based on learning curve and experience.

Pricing

Pricing here refers to the cost of development with either Kotlin or Flutter frameworks.
When it comes to pricing, Flutter is open source and free to make use of, and at the same time, it offers the fastest way to build out your MVP. The time factor and cost for creating a mobile application with Flutter is significantly less because both Android and iOS apps can be built and managed from a single codebase at the same time.

Kotlin is also free and open-source to use — although it only works for Android — and building out a fully fledged mobile application with this framework would require an extra cost of hiring someone to build the same version of the application for iOS and, thus, increase complexity and cost of running two separate codebases.

Speed

When it comes to speed, Flutter performs well but has a few lags in comparison to Kotlin, which is typically faster because it compiles to the format of the target platform. If speed is a huge consideration, Kotlin is the better candidate.

Project set-up and configuration: Kotlin makes use of JetBrains IDE, which includes the popular Android Studio. Flutter, on the other hand, can be set up on more development environments than Kotlin, such as Visual Studio Code and Android Studio itself. The time frame for setting up Flutter and getting started with a project is relatively shorter than that of Kotlin.

Advantages and disadvantages of Kotlin

Advantages:

  • Great performance
  • Suitable for scalability
  • Easy learning curve
  • Good community support and maintenance

Disadvantages:

  • Expensive development cost
  • Increased app development timeframe
  • Fewer third-party libraries

Advantages and disadvantages of Flutter

Advantages:

  • Faster application development timeframe
  • Hot reload feature
  • Elegant user interfaces
  • Fantastic community support
  • Low cost app development

Disadvantages:

  • Larger app size
  • Newer framework ecosystem
  • Fairly new job market
    Code comparison in Flutter and Kotlin

Let’s take a look at a Flutter code snippet of the simple counter application. This application simply displays a zero value at launch and has an increment and reset button for the value displayed on the screen.

CodePen Embed – Flutter Demo

import ‘package:flutter/material.dart’; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: ‘Flutter Demo’, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: ‘Home Page’), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title;

Flutter Demo

import ‘package:flutter/material.dart’; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: ‘Flutter Demo’, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: ‘Home Page’), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title;

The code for the pen above is given below:

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  //increase the value of the counter
  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  //reset the counter value to 0-
  void _reset(){
    setState(() {
      _counter =0;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
         title: Text(widget.title),
      ),
      body: Center(
         child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              '$_counter',style: Theme.of(context).textTheme.headline4,
            ),
            RaisedButton(child: Text("Increase"), onPressed: ()=> _incrementCounter(),),
            SizedBox(height:10),
            RaisedButton(child: Text("Reset"), onPressed: ()=> _reset())
          ],
        ),
      ),
      );
  }
}

MainActivity.kt

package com.example.kotlin_demo

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.activity_main.view.*

class MainActivity : AppCompatActivity() {
    var count = 0

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        textView.text = count.toString()
    }

    fun reset(view : View){
        count = 0
       increment.text = count.toString()
    }

    fun increment(view : View){
        count++
        increment.text = count.toString()
    }
}

main_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/increment"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:onClick="increment"
        android:text="Increase"
        app:layout_constraintEnd_toEndOf="@+id/textView"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="@+id/textView"
        app:layout_constraintTop_toBottomOf="@+id/textView" />

    <Button
        android:id="@+id/reset"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="12dp"
        android:onClick="reset"
        android:text="Reset"
        app:layout_constraintEnd_toEndOf="@+id/increment"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="@+id/increment"
        app:layout_constraintTop_toBottomOf="@+id/increment" />

</androidx.constraintlayout.widget.ConstraintLayout>

Setting up the project above for Flutter took less than 10 minutes on an unsophisticated machine with a ram of 8GB and a core i3 processor. Setting up the Kotlin project and completing it took more than 30 minutes on the same machine.

From this, you can see it’s easier to create an application using Flutter.

This is why Flutter is the best for MVP and start-ups. Besides reducing development time and cost, it runs on both the Android and iOS platforms. And, recently, Flutter Desktop support has just been rolled out to Beta.

The implication of this is that it will soon be ready for production usage. Flutter would be able to run on Android, iOS, web and desktop, simplifying the engineering process and structure for firms and tech companies in the future.

Conclusion

When it comes down to making a choice between either Flutter or Kotlin for mobile application development, all frameworks and programming languages have their ups and downs. But for startups or companies looking to keep the cost relatively low in building out their MVP, Flutter is a great choice to go with.

: Full visibility into your web apps

LogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.

In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.

.
Eshiet Ekemini A graduate of University of Uyo and a tech enthusiast. Ekemini has been building for mobile for two years, with particular focus on Kotlin and Flutter.

9 Replies to “Kotlin vs. Flutter: A guide”

  1. I am guessing you don’t know about Kotlin multi platform. Kotlin as backend? Your view is one sided.

  2. This popped up in my Google Now feed and caught my attention. Disclaimer: as a Sr Android (Kotlin) dev I’m indeed biased, but I’ll try to stick to the facts. In general, I think this is kinda strange to compare a framework and a language, but I guess this is just unfortunate wording.
    A couple of things to note: isn’t Instant Run the “hot reload” feature you talk about? It works fine with both Java and Kotlin.
    Also, I can’t agree with “Fewer third-party libraries” because basically every Java library will work with Kotlin, so you have access to the whole Java universe.
    As for the rest I can agree that Flutter might be a cheaper alternative due to it’s cross-platform nature, BUT: Kotlin is also still new to the market and it’s really hard to find experienced devs, at least in our market which is Germany (I interviewed many candidates for my team recently and must say most are still “thinking in Java”). Flutter is even newer, and what happens when demand is much higher than supply? Right, the salaries go through the roof. So the theory goes at least 😉

    #justmy2cents

  3. “Kotlin is also free and open-source to use — although it only works for Android”
    Kotlin Mutiplatform: am I joke to you?

    And if talking seriously, after reading your title I laughed so hard I nearly pissed myself. Why the hell you compare framework and language? Let’s compare C++ and React then?

  4. I have played with Flutter/Dart and use Kotlin for new projects but still use Java for older apps. I am nervous about using Flutter for complex apps that have heavy dependency on hardware. I like Kotlin as it is a modern language like Swift. I am not as confident that the Dart/Flutter/Fuschia is the future if Android. I also still enjoy the syntax of mature languages like Java and C#. Considering the dependency that Kotlin and Flutter still have on Java, as well as Java’s popularity in other fields, I don’t believe Java is going anywhere any time soon. I tried converting one Java app to Kotlin and it significantly increased my .apk size as well. I believe Kotlin is the future of Android and if your looking for a framework that you can use cross platform there are many options Flutter is just one. Other options for app development like React Native or Unity for game development are just as apealling. Maybe I am just old school but these are my thoughts.

  5. kotlin is very confusing to me. I am used to PHP, so object oriented is not familiar and there are many classes, functions, and syntax that I don’t understand. But flutter is easier, i tried and fall in love in first try

  6. Hey, congrats on the article being featured in Google now! I’ve been coding for Android for 10 years and I think the main issue is the concept of comparing a language to a framework, and going back and forward between comparing superficial language features of Kotlin and Dart languages, and similarly superficial aspects about the Android native SDK and the Flutter SDK, which shows a lack of deeper understanding a bit. You could separate the two, think about what Kotlin and Dart offer you in terms of language features and flexibility to code any (SDK agnostic) piece of logic – how clean, easy to read, succinct they are, etc. And then think about what app features you could deliver using Android SDK and Flutter SDK respectively, and what’s easier in one and harder in the other, and go deeper and more specific into the use cases.
    That way you have not one, but two great articles that would bring a bit more meaningful knowledge to the reader.
    I’m really happy and grateful you’re writing these articles and I hope you keep going! I wish to share a bit of my knowledge for your consideration and not discourage your own voice.

  7. >>Flutter Desktop support has just been rolled out to Beta.
    As of the time of this writing, flutter.dev/desktop page claims this technology is still alpha.

  8. Flutter isn’t a framework, it is an sdk like jdk and many other. probably He ment Kotlin sdk compared to Flutter sdk. Language wise comparison could have been DART compared to KOTLIN, which both are widely used from Client service development, Backend and embedded systems as well.

  9. I also think Flutter is a great choice to go with because of it’s cost relatively low in building out their MVP and Faster application development timeframe. Thank you for this useful explanation.

Leave a Reply