Flutter : Google’s open source mobile app SDK

We have all heard about the different mobile app SDK for building real world apps on Android and IOS which are the 2 major OS’s out there for running apps. What if you were asked to develop an app for targeting both the Android & IOS users ? That would be a challenge right ? Because you would have to learn both Android & IOS development skills and also maintain 2 different code bases for your app.

What if there was a way to just maintain a single codebase for both Android & IOS ? Isn’t that cool ? Yes, thats where Google’s open source mobile app SDK Flutter  comes to the rescue.

Flutter is a new mobile app SDK that helps developers and designers build modern mobile apps for iOS and Android using Google’s Dart language.

Yes you heard that right. You would have to learn a new programming language called Dart to get started with Flutter.
Having Flutter and Dart in control allowed for creating an awesome tooling and IDE integration. It works seamlessly with IntelliJ and Android Studio. Just think about things like debugging and Hot Reload which is a cool feature. But the most important thing that makes Flutter special is the fact that the created apps are really smooth and beautiful. Flutter has a built-in library of Material (Android) and Cupertino (iOS) widgets that are pixel-perfect implementations of Google’s and Apple’s guidelines.

Flutter has a new architecture that includes widgets that look and feel good, are fast, and are customizable and extensible. That’s right, Flutter does not use the OEM widgets (or DOM WebViews), it provides its own widgets.

Flutter moves the widgets and the renderer from the platform into the app, which allows them to be customizable and extensible. All that Flutter requires of the platform is a canvas in which to render the widgets so they can appear on the device screen, and access to events (touches, timers, etc.) and services (location, camera, etc.).

There is still an interface between the Dart program (in green) and the native platform code (in blue, for either iOS or Android) that does data encoding and decoding, but this can be orders of magnitude faster than a JavaScript bridge.

I’ve got myself upskilled with Flutter and will start writing tutorials on how to get started with developing apps using Flutter.

If you have any questions , please do post them in the comment section and I will answer them for you.

Java 8 Series #1 – Lambda expressions

Java 8 is a revolutionary release of the Java for software development platform. It includes various upgrades to the Java programming, JVM, Tools and libraries.

Java 8 provides following features for Java Programming:

  • Lambda expressions
  • Method references
  • Functional interfaces
  • Stream API
  • Default methods
  • Base64 Encode Decode
  • Static methods in interface
  • Optional class
  • Collectors class
  • ForEach() method
  • Parallel array sorting
  • Nashorn JavaScript Engine

Although Java 8 released in March 2014, today not many java developers know the good features that this release has. Even I have not gone through these topics in detail , so I decided to make a Java 8 series of topics covering all the important features that Java 8 has.

In this post I will go in detail with Java 8’s best feature – Lambda expressions

In simple words ,  lambda expressions are anonymous functions, basically methods without declared names, but which can also be passed as arguments to a method as you can with an anonymous class.

If you’re wondering where the term lambda comes from, it originates from a system developed in academia called lambda calculus, which is used to describe computations.

Lets take the example of the below piece of code  which  uses anonymous inner class to associate behavior with a button click .

button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
System.out.println(“button clicked”);

Here we’re creating a new object that provides an implementation of the ActionListener class. This interface has a single method, actionPerformed, which is called by the button instance when a user actually clicks the on-screen button. The anonymous inner class provides the implementation of this method. So all it does is print out a message to say that the button has been clicked.

Anonymous inner classes were designed to make it easier for Java programmers to pass around code as data. Unfortunately, they don’t make it easy enough.  There are still four lines of boilerplate code required in order to call the single line of important logic. Boilerplate isn’t the only issue, though: this code is fairly hard to read because it obscures the programmer’s intent. We don’t want to pass in an object; what we really want to do is pass in some behavior. In Java 8, we would write this code example as a lambda expression as

button.addActionListener(event -> System.out.println(“button clicked”));

Instead of passing in an object that implements an interface, we’re passing in a block of code—a function without a name.  event is the name of a parameter, the same parameter as in the anonymous inner class example.
-> separates the parameter from the body of the lambda expression, which is just some code that is run when a user clicks our button.

So where exactly can you use lambdas? You can use a lambda expression in the context of a functional interface.

I will cover more in detail about functional interface in my next post.


Top 5 javascript frameworks to learn in 2018

For years together Javascript has been a foundation for web development. Javascript lets you build both client-side and server-side applications. It also allows richer UI with content changes on user action like mouse hover, drag and drop, gestures and animations. Most of the Javascript frameworks provide function chaining which allows you to do more with less code, saves time and increase productivity. Javascript frameworks also supports unified browser API so you don’t have to think about browser compatibility.

The advantages of using JavaScript frameworks:

  • Efficiency — projects that used to take months and hundreds of lines of code now can be achieved much faster with well-structured prebuilt patterns and functions.
  • Safety — top javascript frameworks have firm security arrangements and are supported by large communities where members and users also act as testers.
  • Cost — most frameworks are open source and free. Since they help programmers to build custom solutions faster, the ultimate price for web app will be lower.

Looking at the current trend in the IT industry, the below 5 are the must-learn frameworks you should know to keep up the current industry requirements.

1. Angular

Angular is a platform that makes it easy to build applications with the web. Angular combines declarative templates, dependency injection, end to end tooling, and integrated best practices to solve development challenges. Angular empowers developers to build applications that live on the web, mobile, or the desktop.

The current version is 5.0.0 which was released in Nov 2017.

2. React

Facebook is built on it, and it’s usefulness for building UIs is not to be disregarded. It is rightly considered the fastest growing JS framework: as of today, there are about 1,000 contributors on Github. In MVC (Model-View-Controller) pattern React.js acts as “V” and can be smoothly integrated with any architecture. Due to the usage of virtual DOM it provides a great performance boost.

3. Vue JS

Vue.js is better suited for quick and cross platform development building interactive web interfaces. It’s progressive Javascript framework easy to learn and easy to get started for beginners too. Integration of Javascript libraries is easy and can function as powerful advance SPA(single page application). Vue.js is a javascript framework that mainly targets the front-end section of web interface it also mixes some of angular and react.

4. Aurelia

Aurelia.js is a Javascript framework which provides modern and opensource UI for developing web and mobile applications. It allows developer to write clean and modular javascript and focus on web standards. Even though Aurelia.js doesn’t support virtual (DOM) implementation but can achieve the same as (DOM) by using asynchronous binding and batching changes. Aurelia.js is quite new to Javascript framework field but got huge flexibility. And stability that other popular Javascript framework out there.

5. Backbone

Backbone.js is a Javascript framework which gained popularity quickly due to it’s easy and flexible structure. It provides structure to Javascript-heavy application and API with innumerable functions. It is based on (MVP) application design paradigm and used to sync various part of web application. Backbone.js is easy to use and flexible with minimal data-structure which enables less effort for managing it.

Choosing a framework to implement in your project depends on your project requirements, framework functionality and particular use case. It’s not too late now to jump into the javascript bandwagon. Each of these frameworks have great documentation on their website to get you kick started in learning them. Before starting your Javascript framework journey consider learning some of the basic rule and structure of Javascript before getting into the world of Javascript framework.

Happy learning !! Feel free to post in your views in the comments section.