Pitfalls of building a brilliant app

Hand holding phone
Hand holding phone
Photo by Masakaze Kawakami on Unsplash.

1. Things Should Be Where They’re Supposed to Be (Strings, Colors)

There is tremendous growth in the Android ecosystem around the globe with a diverse community. People from different backgrounds, people with disabilities, people who wish to have fancy features like night mode, and more use Android apps in their day-to-day life.

Developing apps for such a diverse community is not an easy task. I’m not speaking about high-level architectures here. In contrast, it’s about simple things like strings, colors, dimens, etc. that will considerably affect modern Android development.

People usually feel comfortable using an application in their native language. The vital step is to maintain all the strings in a…


Multiple view types in RecyclerViews using sealed classes

Phone placed vertically
Phone placed vertically
Photo by Stephen Frank on Unsplash.

One of the best ways to display huge lists in Android is through RecyclerView. As developers, you all might have used it. We have many advanced features like view holder patterns, rich animation, Diff-Utils callback to improve performance, etc. Apps like WhatsApp and Gmail use RecyclerView to show endless conversations.

One of the significant RecyclerView features that I use is view types. We can display multiple view types in the same RecyclerView. …


Photo by Zan on Unsplash

To show alerts like snackbar or dialog is a common task in the modern android application. In this article, you’re going to learn everything about how to display snackbar and alert dialog in Jetpack Compose.

Note: Jetpack Compose recently moved to beta. This means there will no longer be any drastic changes in the API structure. So it would be a great time to learn how to work with this next-generation UI kit for Android development. Layouts are the basic building blocks of the UI, so enjoy the article.

You will need to install Android Studio Canary, Arctic Fox (2020.3.1)


screenOrientation, onSaveInstanceState, setRetainInstance, and ViewModel

Phone
Phone
Photo by Lukenn Sabellano on Unsplash.

In this article, you’re going to learn how to handle configuration changes like screen orientation in Android apps. You will learn the five most commonly used solutions. Pick the one you need based on your requirements.

Introduction

In Android applications, each time a user rotates the screen, keyboard availability, etc., it is known as a configuration change. Configuration changes occur at runtime based on user actions.

When such changes occur, Android components like Activities get recreated or restart. This behavior in Android apps is implemented to adopt the new configuration changes. …


Part 4 of the clean architecture tutorial for Android

Laptop on table
Laptop on table
Photo by Federica Galli on Unsplash.

This is the fourth part of our series on building an Android application with a proper clean architecture. In this installment, we’re going to focus on base classes for Android components and ViewModel to centralize the common work.

Quick Recap

Before going any further, I would highly recommend reading the previous parts of this series where you’ll learn why we should use a clean architecture, how to implement dependency injection using Dagger2, and more.


Photo by Hack Capital on Unsplash

The takeaway from this article

In this article, we’re going to learn how to detect if the app is in the foreground or background. Along with that, we’ll also learn how to detect the visible activity to the user.

Use-cases

In the old days, detecting whether the app is in the foreground or not was one of the common tasks that any android developer used to perform. Back then we didn’t have any fancy libraries like LiveData. So developers were responsible to perform actions when the app was in the foreground.

With the introduction of jetpack libraries, the quality of android development has been improved rapidly…


Row, Column, Box, and ConstraintLayout

Photo by HalGatewood.com on Unsplash

You’re going to learn everything about layouts in Jetpack Compose from the basics to advanced concepts. In the course of this article, you’ll learn about each layout, with real-time examples that you can directly copy-paste into your Compose project to get hands-on experience.

Note: Jetpack Compose recently moved to beta. This means there will no longer be any drastic changes in the API structure. So it would be a great time to learn how to work with this next-generation UI kit for Android development. Layouts are the basic building blocks of the UI, so enjoy the article.

You will need…


Lifecycle, Launch modes, Configuration changes and more

Photo by Headway on Unsplash

Android is one of the leading platforms in mobile development. If you want to reach millions of potential users, defiantly android would be at the top of your list. With this increasing hype, many software engineers choosing android development as their carrier choice.

I’m an android developer for more than five years now, and I’ve been on both sides of the table when it comes to android interviews. So I decided to write a series of articles about android interview Q&A.

Android interviews are a mix of many concepts like android basic to advanced concepts, Kotlin, coroutines, RxJava, Architectures, Design…


Navigate between composable functions, use custom objects as arguments, and more

Driving a car
Driving a car
Photo by takahiro taguchi on Unsplash.

In this article, you’ll learn how to implement navigation in Jetpack Compose. You’ll also learn how to pass primitive data types and custom data objects while navigating.

Note: Jetpack Compose recently moved to Beta. This means there will no longer be any drastic changes in the API structure. As such, it would be a great time to learn how to work with the next-generation UI kit for Android development. Navigation is one of the core tasks in Android development, so enjoy the article.

You need to install the Arctic Fox version of Android Studio Canary to use the Jetpack Compose…


A guide to building MVVM architecture-based apps with Data Binding

View of Earth from space
View of Earth from space
Photo by NASA on Unsplash.

This is the third part of a series in which you’ll learn about Data Binding basics and how to use Data Binding with architecture components like LiveData and ViewModel. Today, you’ll learn how to use Kotlin coroutines and StateFlow to update the UI via Data Binding from a ViewModel.

Introduction

StateFlow

The Flow API in coroutines is a better way to handle…

Siva Ganesh Kantamani

Learn. Code. Write. Repeat. Visit me at https://about.me/sivaganesh_kantamani & Join my email list at https://sgkantamani.substack.com/p/subscribe

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store