Tag: Jetpack

Seeing your composable in shades of grey

Recently, I needed to make a composable look disabled, my friendly design team wanted something quite complex turned to greyscale and made slightly transparent. And it had to be dynamic with changeable data, so I could not just use a drawable for when the composable was in disabled mode, and overlay...

Jetpack Compose Popup — Master It!

When we program our Jetpack Compose View, we might not realize there’s a limitation we cannot use normal Jetpack Compose View programming to achieve. The limitation is as below. In any Compose View, it is not possible to compose another view from within, that is Bigger than the Containing (...

Consuming flows safely in Jetpack Compose

Collecting flows in a lifecycle-aware manner is the recommended way to collect flows on Android. If you’re building an Android app with Jetpack Compose, use the collectAsStateWithLifecycle API to collect flows in a lifecycle-aware manner from your UI. collectAsStateWithL...

A Developer’s Approach to Identifying Jetpack Compose Usage in Apps

Lately, tech circles have been abuzz about the latest Instagram Threads App, with particular emphasis on the ChatGPT App, developed using Jetpack Compose. One might think the only way to confirm this would be through extracting the app and scrutinising the source code, comparing the XML...

Mastering Jetpack Compose Preview: Pro Tips and Tricks

Jetpack Compose makes building Android app screens easier. One of its cool features is the @Preview annotation. This lets us quickly see how our designs look without running the full app. But sometimes, we need to see our designs in different ways, like in dark mode or light mode. Repeatin...

Jetpack Compose Clean and Encapsulated Composables

Over the past year, Jetpack Compose has revolutionized the Android landscape. Its intuitive syntax has significantly simplified the work of engineers. The creation of complex UI components, which was once a daunting task, is now a breeze. With just the use of a Modifier, you can create in minut...

Introduction to Jetpack Compose: Building Android User Interfaces Made Easy

Introduction Are you tired of wrestling with XML layouts and cumbersome UI code in Android app development? Say hello to Jetpack Compose — a revolutionary UI toolkit that’s changing the way developers create beautiful Android interfaces. In this comprehensive guide, we’ll take y...

An Easy To Build First App Using Jetpack Compose

If you have wanted to learn how to build apps but thought it was too complicated, then this is the tutorial to help you get across that learning curve.   Initial Setup For this tutorial we will go over how to build a simple app that will work on any Android device. If you are still new...

Jetpack Compose Clean Navigation

Everybody in the Android world knows that navigation in Jetpack Compose isn’t its brightest side. There are a lot of callbacks and navControllers that you need to pass to execute navigation, and what if you need to do some business logic before sending arguments? Code gets ...

Basics of Jetpack Compose

Maybe you have seen or dabbled in a few other languages in the past and you want to learn something new. Maybe you want to try getting into mobile development. If the answer to any of those questions is yes, this is the place to start. An easy prerequisite If you haven’t already, you wil...

Use Jetpack Compose in your existing Project

In my recent technical talk about “Simplify Android Development with Jetpack Compose” in Google I/O Extended, I met several developers who were interested in using Jetpack Compose in their existing Android apps. They asked me two common questions: “How can I start using Jet...

Building an HourGlass Animation with Jetpack Compose

In this guide, we’ll explore how to use Jetpack Compose to create an HourGlass animation. With the help of a declarative syntax, Jetpack Compose is a contemporary UI toolkit for creating native Android interfaces. Several Compose elements will be combined in our HourGlass animation to simulate...

Changing the Status Bar Color in Jetpack Compose

Every problem solved is a lesson learned. #AndroidTips #SolvedProblemToday Jetpack Compose Changing the status bar color is a common task when designing Android applications. With Jetpack Compose, it’s a simple process that can be done in just a few lines of code. (Only for Mate...

Exploring LazyColumn and LazyRow in Jetpack Compose: Efficient UI for Lists and Rows

etpack Compose, the modern Android UI toolkit developed by Google, has revolutionized the way developers create user interfaces. With its declarative syntax and powerful components, building complex UIs has become more intuitive and efficient. One such set of components that enhance the performance ...

Creating an Animated Counter Button in Jetpack Compose

I recently needed to create a counter button for a simple app. Browsing the internet for inspiration, I stumbled across this design on Dribble by Ehsan Rahimi. Deciding it would be a good challenge to re-create it in Compose, I started playing around with it. Let’s build it together one s...

Jetpack Compose Side Effects in Details

Jetpack Compose has made UI development in Android a lot easier, but it’s still crucial to understand how to manage UI effects properly for better performance. In this article, we’ll explore three important Composable functions that help us manage UI effects effectively: SideEffect, Laun...

Modular Navigation with Jetpack Compose

A large amount of mobile apps will need some form of Navigation, allowing users to move between different parts of an application. When implementing these requirements within Android Apps, applications have either rolled their own solutions, relied on traditional intents or the fragment manager, or ...

Custom Shape with Jetpack Compose

After exploring the Jetpack Compose Canvas in a previous article, this new post will explain how you can draw and use a custom Shape for your Composables to give them a specific outline. The Jetpack Compose foundation library already provides common shapes but we’ll see how...

Building Reusable Components with Jetpack Compose: A Guide to Modularity

Jetpack Compose is a modern UI toolkit for Android that simplifies the process of creating reusable components. By mastering reusable components, you can create more modular, maintainable, and scalable apps. In this blog post, we’ll explore how to build reusable components with Jetpack Compose...

Getting User Location in Android App

Learn how to implement location service into your android app using Kotlin and the Fused Location Provider API. This article will guide you through the process of retrieving the user’s current location and handling common errors that may occur. By the end of this article, you’ll have the...

Getting Started With MVVM in Jetpack Compose

You can find the previous article about the Jetpack Compose tutorial here: A Glimpse Into Jetpack Compose by Building an App Layouting in Jetpack Compose Navigation in Jetpack Compose In this article, we will learn how to apply MVVM to Android applications using Jetpack Compose. Wh...

Jetpack Compose BoxWithConstraints: Make Your UIs Responsive

When building Android UIs with Jetpack Compose, it’s important to ensure that your UIs look and behave correctly on different devices and screen sizes. One way to achieve this is by using the BoxWithConstraints composable. In this article, we'll explore how to use the BoxWit...

Jetpack Compose: Revolutionizing Android UI Development

In the ever-evolving world of Android development, crafting a seamless and visually appealing user interface (UI) has always been a top priority. With the release of Jetpack Compose, a declarative UI toolkit by Google, developers now have a powerful tool at their disposal that simplifies the process...

Jetpack Compose Pagination

Fetching a long list of data from the server is a very costly operation. It takes too long and too much memory. In those situations, the backend will split the list into pages. That is called pagination. We are all familiar with androidx.paging libraries. The most recent version is&nbsp...

Displaying HTML text in Jetpack Compose

Hello everyone, in this short article I will be showing you how to display HTML text in Android. At the time of writing this article, Jetpack compose’s Text composable doesn’t allow us to do this. But, thanks to the great interop support for compose, we can use the TextView or MaterialTe...

Jetpack Compose Request Permissions

Jetpack Compose is a powerful toolkit for building modern Android user interfaces. One important aspect of many Android applications is the ability to request permissions from the user. In this article, we will explore how to request permissions in a Jetpack Compose application, with a basic example...

Mastering LazyColumn in Jetpack Compose: Efficient List Handling

Jetpack Compose is revolutionizing Android app development with its declarative UI approach. One of its most powerful features is the LazyColumn composable, which provides an efficient way to display large lists. In this article, we will explore the basics of LazyColumn, its advantage...

Deep-Linking in Jetpack Compose — Android

In this article, we’ll learn how to easily implement deep-linking in Jetpack Compose. What is Deep-Linking? Deep-linking allows users to navigate to specific content within an app directly from an external source, such as a website or another app. Dependency Go ahead to&nb...

Integrate Google Maps Into the Jetpack Compose App

Today we are gonna talk about how to integrate maps into your Jetpack Compose app. For that, we are gonna use the Maps Compose Library. “The Maps Compose library contains composable functions and data types that let you perform many common tasks.” According to Maps Compose Libr...

Multi-List Item Selection in Jetpack Compose

The option to select multiple items in a list is a very common functionality we can see in a lot of apps like Gmail, WhatsApp, Files, Messages, etc. Screenshot from Gmail and Files app (from Google) We will explore the process of developing a similar user interface (UI) using Jetpack C...

Clickable SpannableText in Jetpack Compose

Previously I have posted an article how we can span a text in jetpack compose . See here In compose if you want to make a text clickable either you can us Modifer.clickable on a Text or ClickableText. But We’ll use ClickableText because it also give the offset of char...

Essential Android Security: Protecting Your App

We’ll begin our journey through Android apps security from a minimal setup. The app is already using HTTPS-only connections (or WSS in the case of WebSocket), and the backend is secure on its own. Basic initial setup What could go wrong? Lots of things! First of all, be sure ...

How to fix the Jetpack Compose Preview Error:ViewModels creation is not supported

When you create complex enough Views in Jetpack Compose, you reach the point when you need to couple the View with an IO operation controller. One of the standard solutions for that that I prefer, for now, is the MVVM pattern and the HiltViewModel. Usually, when a view appears on the screen (duri...

How to add background image to your Android project with Jetpack Compose

There could be instances when we might decide to use an image as the background instead of the default background color for some specific screens in the Android app we are developing. With the combination of Jetpack Compose and Kotlin programming language in Android Studio, this can be easily achiev...

Add blur effect to Image in Jetpack Compose

Hi guys, today I want to share this little article where I briefly explain how to create a blurry image on Android. Without so much introduction, let’s get to the point.  Blur is a visual effect that is often used in graphics software to reduce the clarity or sharpness of an image or v...

Exploring Jetpack Compose Canvas: the power of drawing

In this article, I will share my experience of using Canvas with Jetpack Compose, which is the new UI toolkit made by Google. The Android Dev Challenge #2 gave me the opportunity to learn tons of things about Canvas and how to take advantage of it to draw and animate shapes or texts in a v...

Jetpack Compose: The Future of Android App Design

Jetpack Compose is a modern UI toolkit for building native Android apps using a declarative approach. It allows developers to create stunning and interactive user interfaces by describing the desired UI hierarchy and behavior in simple, composable functions. With Jetpack Compose, you can focus on...

Android Jetpack Compose: Inset Padding Made Easy

Ina typical Android App, other than the app content, there are other visible elements on shown top of the app, as shown in the picture below. They are called Insets.   Sometimes we want to expand our app content’s view into these insets area, or we want to pad our view not to be blo...

From Android to Multiplatform: Migrating real 100% Jetpack Compose App to fully Multiplatform App.

App is habit tracker like. User is able to define steps in the process and track consistency. User either wins or loses. The goal is to keep win streak going. Some of the things app is using: Jetpack Compose for UI Hilt for Dependency Injection Jetpack Navigation for navigation ViewMo...

Exploring Mapbox: Create Engaging Apps with Mapbox and Jetpack Compose

Let’s explore how to use Mapbox and Jetpack Compose to build engaging map applications. You can create interactive and dynamic map experiences for your Android app by combining Mapbox’s mapping capabilities with the friendly Jetpack Compose framework. This tutorial will walk you through ...

DateRangePicker Using Jetpack compose

The DateRangePicker is a user interface component in Android that allows users to select a range of dates. It is commonly used in applications where a date range selection is required, such as booking systems or event planners. Add below dependency implementation "androidx.compose.mater...

Jetpack Compose Canvas: 10 Practical Examples

Jetpack Compose is revolutionizing the way we build user interfaces on Android. One of the many features it offers is the Canvas API, which allows developers to draw custom shapes, paths, and graphics. In this blog post, we will explore 10 practical examples of using the Canvas API in Jetpack Compos...

Android Jetpack Compose: CompositionLocal Made Easy

InJetpack Compose, we commonly heard about Recomposition and Remember, the two important concepts to grasps how one can work with Jetpack Compose. Android Jetpack Compose: Recompositiom Made Easy Android Jetpack Compose: Remember Made Easy However, when we check out the&n...

Best Practices for Using Jetpack Compose: Boost Your App’s UI with Examples

Jetpack Compose has revolutionized the way we build Android UI. As developers embrace this modern toolkit, it’s important to follow best practices to ensure your app’s UI is efficient, maintainable, and scalable. In this blog post, we will explore some of the best practices for using Jet...

Jetpack Compose — Drawing custom shapes (Circle, Rect, Paths)

Before starting, it’s good to have a grid notebook, something you can just use pen and paper and draw what you want to draw there first. The 0,0 is always in the top left corner. It’s basicly the reverse coordinate system. In a grid of 100x100, the bottom right corner is 100,100. All the...

WebView in Jetpack Compose

A WebView in a native app is a view component that allows you to display web content, seamlessly enhancing your Android applications with web functionality. They are relatively easy to use. Let’s build an Android app that integrates the Longman Dictionary using a WebView. Now, what do we ne...

MVVM Architecture in Android with Jetpack Compose

In the ever-evolving world of Android app development, choosing the right architecture is crucial. It can make the difference between a codebase that’s easy to maintain, test, and extend and one that becomes a tangled web of complexity. One architecture pattern that has gained widespread adopt...

Picking Images From Gallery Using Jetpack Compose

Grab a cup of coffee  and let’s see how to pick images from the gallery using Jetpack Compose. Setup We need to use a dependency called Coil in order to display the images. To add it just open :app/build.gradle.kts and paste this into the dependencies block. ...

Navigation in Jetpack compose. Full guide Beginner to Advanced.

What is Navigation in Android? Navigation helps you in understanding how your app moves across different components in your Application. Android JetPack Navigation helps in implementing your high-level navigation in a go easy approach. The Navigation Component is made up of three ...

Life Cycle In Jetpack Compose

In Android, the life cycle refers to the series of states that an application component, such as an Activity or Fragment, goes through during its lifespan. Each component has a set of life cycle methods that are called by the Android system at different stages, allowing developers to execute code an...

Screen Transition Animations with Jetpack Navigation

I’ve recently delved into how to add support for navigation in Android using Jetpack Compose. To do so, I created a small app that consumes an API and has a Main -> Detail screen. In this post, we’ll go through the basic setup of the project, its key elements to handle navigation, and...

Input Validation With Clean Architecture In Jetpack Compose

Input validation is an essential aspect of app development as it helps to prevent unexpected user input, data corruption, and security vulnerabilities. With the increasing popularity of Jetpack Compose in Android development, it is important to understand how input validation fits into the Clean Arc...