72 Topics

Member Avatar for
Member Avatar for dimitrilc

## Introduction ## Among all of the Android libraries, Paging 3 is perhaps one of the hardest to understand. Personally, I think the problem with Paging 3 are: 1. Developers need to learn a lot of custom classes before they can understand how Paging 3 works under the hood and …

1
539
Member Avatar for dimitrilc

## Introduction ## The Android Paging 3 library can operate in two modes, with an offline Room database as a source of truth or without one. In this tutorial, we will look at how to use Paging 3 with a local Room database. This tutorial expands on the previously published …

1
1K
Member Avatar for dimitrilc

## Introduction ## Among the many ways to create your own View, extending an existing View is the simplest option. This is because you are inheriting pre-made attributes, drawing, and accessibility features. In this tutorial, we will learn how to create our own custom View by extending an existing View …

2
82
Member Avatar for dimitrilc

## Introduction ## In this tutorial, we will learn how to apply Material 3 colors and Dynamic Colors to our App. ## Goals ## At the end of the tutorial, you would have learned: 1. How to apply Material 3 colors. 2. How to enable Dynamic Colors. ## Tools Required …

2
456
Member Avatar for dimitrilc

## Introduction ## In Android development, UseCases are classes that encapsulate business logic that are often used in ViewModel classes. UseCases belong to the optional Domain layer in Android apps, so they are not required, but can reduce your ViewModel’s complexity and make your application easier to test. In this …

2
447
Member Avatar for dimitrilc

## Introduction ## When working with WorkManager, it is important to know how to provide input data to your Workers. In this tutorial, we will learn how to provide basic input data to a Worker as well as when Workers are chained together. ## Goals ## At the end of …

2
167
Member Avatar for dimitrilc

## Introduction ## If your App only need a simple way to play videos on Android, then **VideoView** (`android.widget.VideoView`) might just fit the bill. In this tutorial, we will learn how to use VideoView for video playback in our App. ## Goals ## At the end of the tutorial, you …

Member Avatar for Iqra_18
3
121
Member Avatar for dimitrilc

## Introduction ## Android provides many ways to perform background tasks, such as Services, WorkManager, or even threads. In this tutorial, we will learn how to create a Service for our Android app. ## Goals ## At the end of the tutorial, you would have learned: 1. How to create …

Member Avatar for Iqra_18
2
291
Member Avatar for dimitrilc

## Introduction ## When using a Worker (**from the WorkManager library**), you might have wondered how to inject dependencies with Hilt. In this tutorial, we will learn how to inject dependencies into our Worker. ## Goals ## At the end of the tutorial, you would have learned: 1. How to …

1
870
Member Avatar for dimitrilc

## Introduction ## Finding a View in Espresso tests can be quite confusing because there are so many matchers available. In this tutorial, we will learn how to find a View based on its sibling contents. ## Goals ## At the end of the tutorial, you would have learned: 1. …

1
268
Member Avatar for dimitrilc

## Introduction ## When working with Room, you might have wondered how to run multiple statements in a single transaction. Running multiple statements in one transaction has two main benefits: 1. Your statements can reuse the same connection. 2. They can all fail together if something goes wrong. Regarding the …

1
461
Member Avatar for dimitrilc

## Introduction ## When working with Room, you might have wondered how to describe one-to-many relationships between entities. In this tutorial, we will learn how to do just that. ## Goals ## At the end of the tutorial, you would have learned: 1. How to define one-to-many relationship for entities …

1
1K
Member Avatar for dimitrilc

## Introduction ## There are many ways to describe relationships between Entities in Room, one of which is to embed an entity inside of another. When embedding an Entity, the columns of the embedded Entity are extracted as member columns of the enclosing entity. In this tutorial, we will learn …

1
152
Member Avatar for dimitrilc

## Introduction ## When working with Services on Android, you might have ran into an issue where you would like to: 1. Use a concrete implementation of a Service (*from a built-in or third party library*). 2. Make the Service lifecycle-aware so that you can use coroutines with it. Many …

1
2K
Member Avatar for dimitrilc

## Introduction ## When working with Room, there might come a situation during bulk CRUD operations that it would be useful to add a Foreign Key to one of our tables. This provides two main benefits: cascading delete (*must be configured manually*) and enforcing data integrity on linked entities. In …

3
6K
Member Avatar for dimitrilc

## Introduction ## If your Android Application uses Room, then you might have wondered how to prepopulate a Room database. In this tutorial, we will learn how to prepopulate a Room database. ## Goals ## At the end of the tutorial, you would have learned: 1. How to prepopulate a …

1
1K
Member Avatar for dimitrilc

## Introduction ## When working with music files, you might have wondered how to load display art from Audio files. In this tutorial, we will learn how to load thumbnails for audio files. ## Goals ## At the end of the tutorial, you would have learned: 1. How to load …

2
1K
Member Avatar for dimitrilc

## Introduction ## When working with Hilt, you might have wondered how to inject ViewModels into your application. In this tutorial, we will learn how to inject ViewModels into your app Fragments. ## Goals ## At the end of the tutorial, you would have learned: 1. How to inject ViewModels …

4
1K
Member Avatar for dimitrilc

## Introduction ## In Android development, reusable layouts can be used to reduce duplicate code across XML files. In this tutorial, we will learn how to reuse layout files, especially with View Binding enabled. ## Goals ## At the end of the tutorial, you would have learned: 1. How to …

2
524
Member Avatar for dimitrilc

## Introduction ## MediaPlayer (`android.media.MediaPlayer`) is a popular way to play media files, and combining it with a SeekBar can greatly improve the user experience. In this tutorial, we will learn how to synchronize a MediaPlayer progress to a SeekBar position. ## Goals ## At the end of the tutorial, …

2
1K
Member Avatar for dimitrilc

## Introduction ## When working with a Room database, we are mostly restricted to save data using primitives (*and boxed primitives*). Reference types are not supported right out of the box, but can be enabled by creating additional [TypeConverter](https://developer.android.com/reference/androidx/room/TypeConverter). If you are familiar with ORM-light frameworks such as Spring JDBC, …

2
2K
Member Avatar for dimitrilc

## Introduction ## In this tutorial, we will learn how to add swipe-to-remove and drag-to-reorder functionalities into RecyclerView. ## Goals ## At the end of the tutorial, you would have learned: 1. How to add swipe-to-remove and drag-to-reorder functionality to a RecyclerView. ## Tools Required ## 1. Android Studio. The …

2
179
Member Avatar for dimitrilc

## Introduction ## When using Navigation Components, you might have wondered how to pass arguments between destinations. We will learn how to do just that in this tutorial. This tutorial also builds upon the [Basic Navigation](https://www.daniweb.com/programming/mobile-development/tutorials/536923/android-native-how-to-use-navigation-component#post2282945) tutorial, so if you are not familiar with Navigation Components, I would recommend you …

1
204
Member Avatar for dimitrilc

## Introduction ## If you are working on a native Android app using the View system, then you might have come across a situation where you would need to add a Composable (`androidx.compose.runtime.Composable`) into your View hierarchy. In this tutorial, we will learn how to add a Composable into an …

2
265
Member Avatar for dimitrilc

## Introduction ## When working on Android with Kotlin, you might have ran into property delegates on a few occasions, such as `activityViewModels()` from `androidx.fragment.app` or `remember()` from `androidx.compose.runtime`. In this tutorial, we will learn what property delegates are and how to create them ourselves. ## Goals ## At the …

3
147
Member Avatar for dimitrilc

## Introduction ## If you are working with the latest Material 3 libraries on Android, you might have wondered how to use the **Bottom Navigation Bar** in your App. In this tutorial, we will learn how to use the Material 3 Bottom Navigation Bar (BNB). ## Goals ## At the …

2
2K
Member Avatar for dimitrilc

## Introduction ## Proto DataStore is a great way to store the **permanent** state of your application, especially if you prefer type safety. In this tutorial, we will learn how to store our App state using the Proto DataStore. ## Goals ## At the end of the tutorial, you would …

2
105
Member Avatar for dimitrilc

## Introduction ## The **Storage Access Framework** (SAF) provides a great way to access files exposed by other applications via their own DocumentProviders. In this tutorial, we will learn how to use the SAF in our App. ## Goals ## At the end of the tutorial, you would have learned: …

1
347
Member Avatar for dimitrilc

## Introduction ## In Android development, the MediaStore API is a great API to use if you are building a music player. In this tutorial, we will learn how to query for audio files in the MediaStore database. ## Goals ## At the end of the tutorial, you would have …

1
537
Member Avatar for dimitrilc

## Introduction ## The release of Android 12 also came together with Material 3. Whether you love it or hate it, it is likely to be here to stay for a couple of years, therefore, it would be useful to know how to use it. In this tutorial, we will …

2
2K

The End.