Category Archives: Android

SOLID PROGRAMMING – LISKOV SUBSTITUTION PRINCIPLE

Substitutability is a principle in object-oriented programming stating that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e. an object of type T may be substituted with any object of a subtype S) without altering any of the desirable properties of the program (correctness, task performed, etc.). More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strongbehavioral subtyping, that was initially introduced by Barbara Liskov in a 1987.

The Liskov Substitution Principle is the third of Robert C. Martin’s SOLID design principles. It extends the Open/Closed principle and enables you to replace objects of a parent class with objects of a subclass without breaking the application. This requires all subclasses to behave in the same way as the parent class.

Therefore:

Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.” – Robert C. Martin

A violation of this behaviour would imply your code is not SOLID and it may be prone to malfunctioning.

Google play app review times

  • UPDATE AUGUST 2020

The fast boy is no longer the quickest.

Google used to publish Apps almost instantly, no quality review whatsoever, as result, the Google Play Store was full of garbage. Crappy Apps, malicious Apps and overall useless Apps were rampant. Several scandals and privacy breaches after, Google said, no more… “We will review the Apps and ensure some quality across the board”, (turns out that, although criticized, Apple was right, all the time).

Continue reading Google play app review times

Listening to EXOplayer events

Kotlin 2020 solution approach UPDATE

Events such as changes in state and playback errors are reported to registered Player.EventListener instances.

Player.EventListener has empty default methods, so you only need to implement the methods you’re interested in.

First your class, say your activity, has te conform to the Player.EventListener interface.

Continue reading Listening to EXOplayer events

kotlinx.serialization library, the chosen one

It seems clear today that kotlinx.serialization is the chosen one.

Among all the many libraries to parse JSON with Kotlin in Android. Say… Klaxon, Jackson, Gson, Json2kotlin, etc. kotlinx.serialization is presently attested champion.

There’s no doubt kotlinx.serialization is the future as it is part of Kotlin libraries now. Although it is still at the time of writing this post in incubator stage.

Continue reading kotlinx.serialization library, the chosen one

An easy way to generate your color palette for Android and iOS

material.io is a free, no trick, easy grab, palette tool that will allow you compose your color harmony for Android and iOS in a very simplistic way.

This website is based on Material Design, which is a design language developed by Google. Very popular across the board.

https://material.io/resources/color here you may find a large array of colors and easily generate primaryColor, primaryLightColor, primaryDarkColor, secondaryColor, primaryTextColor, etc.

On top of that, it will allow you to download straightaway a colors.xml or colors.xml file with all the constants well defined, which is pretty convenient. Ready to drop into your Android Studio or XCode project.

Fancy trying? Take a look at it!

An easy way to make MVC great again!

If you are a professional iOS or Android developer and you explicitly manifest your love for MVC as base architecture for your Apps, you are a leper and would be ostracized. 

Nowadays the MVC is frowned upon and not in the favor of altruistic developers.  

Viper, React, MVVM, those are good, MVC is bad and crappy… 

Truth or myth? 

Well, MVC is old indeed and certainty it got its flaws, most common of all, the feared “massive view controllers”. 

 But although the new aforementioned architectures bring to the table some solutions to MVC intrinsic issues, they do have some flaws as well, yeah “nobody is perfect”.

MVC is great, programmers are just too careless.

Continue reading An easy way to make MVC great again!

Kotlin vs Java. what should i pick for my new android project?

Unlike iOS, where Swift is overtaking Objective-C rapidly and the momentum is clear. In the Android world, presently, the language option is not that clear.

Yes, Kotlin is there, new, coming forward, garden-fresh, 21-century ready but it isn’t ultimately taking off, not as expected.

Kotlin was first introduced by JetBrains in 2011, which is the creator of IntelliJ IDEA, PyCharm, and many other top IDEs. It got its name from ‘Kotlin Island’ in St. Petersburg, Russia. Made to strike Java.

That said, the dominance of Java is still immense, the number of libraries, APIs, code generally speaking is humongous. Not to mention the readability of it, the many algorithms and things done or thought already in Java, yeah… Simple as it sounds, it’s hard to break a solid present for a “uncertain” bright future.

Continue reading Kotlin vs Java. what should i pick for my new android project?