Mobiles are now available in a variety of sizes, which is why it is so significant to provide a flexible and responsive UI. We need to design the user interface of our app completely flexible so that it is displayed correctly on all devices. This article will show you how to support different screen sizes using the tools available in Android (For other devices such as Android wear, TV,… we have to take more steps).
You can also see Responsive UI code implementation in my GitHub.
The best way to create a responsive UI is to use ConstraintLayout as our base layout file because, in ConstraintLayout, we can specify the position and size for each view according to spatial relationships with other views in the layout. We can convert LinearLayout to Constraint or use the layout_weight option to make the UI flexible(but in nested LinearLayout it slows our UI performance). …
In this article, I am going to create a sample project (app) that will help us understand Clean Architecture. This project is an application that the first page shows you a list of data characters which are in the Rick and Morty series, and by clicking on each character, the next page shows you the episodes those characters are in.
By this explanation, it shows that we have two types of existence. The character and the episode.
So in the first place, why do we want to use clean architecture?
Models are the most used classes in java. When you want to create an object with a different configuration How do you define the modal class to create the object easily? There are 3 ways to do that: telescoping constructor, Java Bean pattern, and Builder pattern, and the first way is an anti-pattern. When the model class has optional fields, the first way creates more constructors so we use the builder pattern to solve this problem. Below, each will be explained.
1.Telescoping Constructor: Traditionally, programmers have used the telescoping constructor pattern in which they provide a constructor with only the required parameters, another with a single optional parameter, or one with two optional parameters, etc. This way is safe but it creates many constructors. Imagine you have 5 fields and 3 of them are optional. So you have to create 4 constructors. …