Wednesday, May 20, 2020

Flutter Project Structure


To fully understand flutter, we need to understand its project structure, So we can know which file and folder do what, and why they exist.

The Files and Folders that we mainly use



This section contains files and folders that we mainly used while developing apps.

Android and iOS directories

Android and iOS directories hold a complete Android and iOS app respectively, with all their respective files. Whenever you want to implement any platform specific feature you can implement it by going in these directories.

lib directory

The lib directory holds all your dart code used to run your app.

pubspec.yaml

pubspec.yaml is a special file. It contains your app name, description, SDK version, dependencies, and other important stuff.

test directory

The test directory is for writing tests in dart similar to instrumented tests in Android using Espresso.


The Files and Folder that we mainly don’t touch
  • In 99.99% of cases, we don’t touch these files. As manually edit them can destroy the entire project (expect .gitignore, and README.md).
  • .idea directory holds all project specific settings. Settings are stored mainly in the form of XML files. We normally don’t touch these folders.
  • The .gitignore file is a text file that tells Git, which files or folders to ignore in a project.
  • .metadata, .packages, pubspec.lock are generated by flutter itself. These files are used by the framework itself for internal usages. We normally don’t touch them. As they perform internal tasks.
  • README.md is a markdown file mainly used in version control like Git for representing information of other files.


So that is for project structure. I hope it's easy and straight forward to understand.



Flutter Compilation Process


While learning any framework or Programming language its very necessary to understand how platform complies your code. How the whole compilation process is done. It gives you more understanding of platform and core programming concepts. Next Step in our journey towards learning Flutter is to understand flutter’s compilation process and how flutter creates its single code base magic. So let’s get started.

Any app in the Flutter is created with the help of three languages Dart, C and C++. Here you can also tell that every flutter application is a combination of these three language’s code.

For which purpose these three languages are used?

Here Entire Flutter framework is created in Dart and it is also used by us to develop an app. Here also notice that we do not directly use C and C++ code to write apps, instead, C and C++ code is used in Graphic rendering engine and Dart Virtual machine to perform their tasks.

So now let’s understand how iOS and Android compile these three codes.

How flutter code compiles for Android?
  • Graphics Engine’s C and C++ code are compiled with the help of Android’s NDK (Native Development Kit).
  • The dart code both SDK’s and ours are compiled through AOT (Ahead-of-Time) compilation process to native ARM and x86 libraries.
  • After successful compilation, the APK file is generated.
  • Any widget rendering, input-output, event handling and so on is done by compiled app code.
  • Here notice that Debug mode builds use a Dart virtual machine to run Dart code in order to enable stateful hot reload.

How flutter code compiles for iOS?
  • Graphics Engine’s C and C++ code are compiled with the help of LLVM (Low-Level Virtual Machine).
  • The dart code both SDK’s and ours are compiled through AOT (Ahead-of-Time) compilation process to native ARM libraries.
  • After successful compilation, the IPA (iOS extension same as APK) file is generated.
  • Any widget rendering, input-output, event handling and so on is done by compiled app code.
  • Here notice that Debug mode builds use a Dart virtual machine to run Dart code in order to enable stateful hot reload.

So that is the flutter’s compilation process for both platforms. I hope it's easy and straight forward to understand.

Tuesday, May 19, 2020

What is Google Fuchsia? Everything You Need to Know.

Fuchsia is an open-source capability-based operating system currently being developed by Google. It is first became known to the public when the project appeared on a self hosted form of git in August 2016 without any official announcement

Today there are five major operating systems in the world. In Computers Windows, macOS and Linux and in the smartphones, Android and iOS. But this creates a lot of problems for the developers and consumers.

Following are some issues due to the fragmentation of Operating systems:

1. More OS means more platforms and more app creations - Due to OS fragmentation developers need to create more apps for each platform to increase their reach to customers.

2. More OS means more resources and more management needs for companies - More OS needs more resources and more management work for companies. For example, Google needs to provide security-patches for each android versions. Also, it causes a headache for developers because while creating apps they need to take care of old android versions as well. So that sometimes they need to sacrifice some features.

3. Users found themselves in different UI experiences - Because of different kind of operating systems user faces a different kind of user interfaces. Each OS works and functions differently. When the user switches from one to another they need to learn that OS and forgot the habits of using an old one.

So these are three main reasons that we have faces due to OS fragmentation. Now you may be thinking why you tell these all reasons to us. Guys, I stated these reasons so that you can understand the needs and impact that Fuchsia can make in the OS world.

What is Project Fuchsia?

Fuchsia is first known on the Internet while the project first appeared on GitHub in August 2016. At that time Google didn’t announce such project publicly. Google puts it free and open-source under a variety of licenses including BSD 3 clause, MIT, and Apache 2.0.

Its major part is written in Dart but Google also uses other languages such as C, C++, Swift, Go, Python, Rust, and Shell. Unlike Android and Chrome OS Fuchsia is not based on Linux Kernel, It is based on a new micro kernel called Zircon.

Another surprising thing is Fuchsia’s user interface and apps are fully written in Flutter(The Mobile development SDK). Which made Fuchsia’s UI faster(120 fps), smoother and cross-platform. Flutter’s widgets use Material Design Interface Guidelines that means UI and apps of Fuchsia will be much more beautiful than others. Flutter also offers Vulkan-based graphics rendering engine called “Escher” which provides faster graphics rendering.

Expected implementations of Fuchsia OS

From the code inspection of GitHub, it seems Fuchsia is capable to run on Universal Devices from Embedded systems to smartphones, tablets, and personal computer as well.

That means One OS for all platforms. If Fuchsia is implemented on its full potential then we can expect it everywhere. Whether it is your smart watch, smart glasses, smart refrigerator, smart speakers, smart assistance, personal computers, security devices or anything else you can imagine. If it is implemented on its full potential, Fuchsia will be everywhere.

Fuchsia is still under development and we can expect more features and device support in future.

Monday, May 18, 2020

What is Flutter?


Flutter is an open-source UI software development kit created and released by Google in May 2017 to develop beautiful native compiled app for mobile (Android & iOS), desktop (Windows/Mac/Linux), Google Fuchsia and web.

To develop Flutter, you will need the programming language called Dart. Which is Google's language created in October 2011.

The biggest advantage that Flutter gives us free and cross-platform support, that means you can use one programming language and single code base for different platforms like Android, iOS, Web, Desktop, etc.

On December 4, 2018, Flutter 1.0 was released their first stable version at the Live event. Since then Google is working hard to improve the Flutter and again released their another version Flutter 1.12 on December 11, 2019.