Mobile Development Approaches and Flutter Architecture: FLUTTER PART-I
When it comes to developing mobile applications, one major issue is to decide what all operating systems should the application support. Majority of applications stick to just Android and IOS because of their unprecedented market share in Mobile OS.
Second major issue is to decide the approach while developing the application for both platforms. Listed below are few such approaches:
- Single Platform — Native Application
- Multiple Platform — Hybrid or Native Applications
Single Platform : Every operating system comes with its own set of SDKs to develop application with quick response time, graphic performance and Native service support ( Location, Cellular, Camera, Sensors, Bluetooth etc.).
Pros: Fast, responsive, continuous support and wide variety of features in SDKs
Cons: When a product is present on more than one platform, maintaining two different codebase, respective developers and synchronising features across applications becomes a bottle neck in most setups.
Multiple Platform : When supporting multiple platforms with the unified style and codebase, we come across plethora of options listed below :
- Cross-Platform Applications: These are types of software application that work on multiple operating systems or devices, which are often referred to as platforms. A platform means an operating system such as Windows, Mac OS, Android or iOS.
Pros: Continuous integration like a web application where any changes to the application can be deployed as and when required. The same application can be used on web platform.
Cons: It uses native browser which is relatively slower and results in bad user experience due to the bottlenecks it comes with. Its also uses a BRIDGE to interact with native services that is even slower.
Pros: Relatively faster than Hybrid approach and uses OEM widgets which imparts better user experience.
Cons: Uses a bridge to excess OEM UI elements and services which are slower.
To solve few of the bottlenecks faced in fore-mentioned approaches, Flutter comes to our rescue, checking most boxes and giving us good reasons to choose it as a framework for cross-platform mobile application development.
To start with, the first real advantage of using flutter is that it’s fast. The whole intent behind launching it was to provide fluid user interface at 120fps. Its eliminates the need of bridge to render views as it comes with its own Flutter engine(c++) to render views.
Secondly it offers plethora of platform specific design elements and user experience out of the box; native to Android and IOS.
Pros: Speed, performance, flexibility, native look and feel, rapid development.
Cons: Its relatively new in comparison to other options in the list. The apk/ipa size is relatively large as it is shipped with the native code, the render engine and platform channel which is a problem for all cross-platform application approach.
All we can ask for will be delivered by Flutter in times to come when it is launched via stable channel. Even though its alpha version was launched in 2015, the beta build for the same has recently been release in 2018 Google I/O.
Google introduced the first version of Flutter in 2015 (at Dart Developer summit) with the name ‘Sky’. The intent behind creating an open-sourced mobile application development SDK was to provide an engine that can consistently give 120fps render frame rates. It initially supported Android alone.
Flutter comprises mainly of four components :
- Flutter Engine : It is primarily based on C++ language and is used to render low level graphics using Google’s open source graphic library Skia.
- Foundation Library: All the basic building blocks for writing a Flutter application are packaged under this and written in Dart.
- Widgets: A widget in Flutter represents an immutable description of part of the user interface; all graphics, including text, shapes, and animations are created using widgets.
- Design Specific Widgets: The Flutter framework contains two sets of widgets which conform to specific design languages namely Material Design for Android Side and Cupertino Style for IOS side.
Skia graphic engine is an open sourced project is used in Google Chrome, Chrome OS, Chromium OS, Mozilla Firefox, Android (although partially superseded by HWUI starting with Android), Firefox OS, Flutter and Sublime Text 3.
Skia has a conventional CPU-based path renderer but has recently integrated a new OpenGL ES2-accelerated back-end called Ganesh. Ganesh has experimented with two accelerated approaches. The first used the stencil buffer to render paths. Because of API overheads with this approach, this first approach was replaced with a second approach where the CPU-based rasteriser computes a coverage mask which is loaded as a texture upon every path draw to provide the GPU proper antialiased coverage. This hybrid scheme is often bottlenecked by the dynamic texture updates required for every rendered path.
Who uses flutter?
- Fuchsia: A capability-based, real-time operating system (RTOS) currently being developed by Google.
- Google AdWords
- AdSense performance reports
- Google internal CRM
- Google Fiber
- Many others : LINK
Now that we have established the advantages and difference in different approaches; we will start to discuss on how to jump into flutter and make awesome looking fluid application in the series of articles mentioned below:
- Flutter architecture and Mobile development approaches.
- Basics of Dart programming.
- Flutter Introduction.
- Flutter Components I
- Flutter Components II
- Flutter Essential Libraries.
- Flutter and Firebase.
- Animations in Flutter.