# Sergio's little tech corner

Android GDE. I make things happen

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Using Compose Previews to Preview XML-Based Android Views

DevFeed: [Using Compose Previews to Preview XML-Based Android Views](<https://devfeed.tech/articles/back-to-the-future-compose-previewing-your-xml-based-views-25687.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/back-to-the-future-compose-previewing-your-xml-based-views>)

Author: Sergio Sastre Florez

Published: 2024-12-17T20:09:09Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [compose](<https://devfeed.tech/tags/compose.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [layout](<https://devfeed.tech/tags/layout.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

This tutorial explains how Jetpack Compose Previews can be used to preview XML-based Android Views, including ViewHolder UI logic and dynamic behavior that static XML previews cannot represent.

### Source excerpt

Jetpack Compose has transformed Android UI development with its declarative approach, making UI code simpler to write. One of its standout features is Compose Previews, which allows developers to instantly view how Composable functions will look on a...

## Efficient Testing with Robolectric & Roborazzi Across Many UI States, Devices and Configurations

DevFeed: [Efficient Testing with Robolectric & Roborazzi Across Many UI States, Devices and Configurations](<https://devfeed.tech/articles/efficient-testing-with-robolectric-roborazzi-across-many-ui-states-devices-and-configurations-25690.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/efficient-testing-with-robolectric-roborazzi-across-many-ui-states-devices-and-configurations>)

Author: Sergio Sastre Florez

Published: 2023-11-09T21:45:00Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Software Process](<https://devfeed.tech/topics/software-process.md>), [enum](<https://devfeed.tech/topics/enum.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [devices](<https://devfeed.tech/tags/devices.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [espresso](<https://devfeed.tech/tags/espresso.md>), [google](<https://devfeed.tech/tags/google.md>), [robolectric](<https://devfeed.tech/tags/robolectric.md>), [roborazzi](<https://devfeed.tech/tags/roborazzi.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [screenshots](<https://devfeed.tech/tags/screenshots.md>), [software](<https://devfeed.tech/tags/software.md>), [software-process](<https://devfeed.tech/tags/software-process.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

### AI overview

This tutorial explains how to use Robolectric and Roborazzi for screenshot testing across many UI states, devices, and configurations. It introduces parameterized tests, enum-based UI states, and device qualifiers for generating screenshots efficiently.

### Source excerpt

Robolectric is a popular UI testing tool from Google that enables running UI tests without a physical device or emulator. It supports most androidx.test APIs, like Espresso, ActivityScenario & FragmentScenario as well as ComposeTestRule. Robolectric ...

## Write Once, Test Everywhere: Cross-Library Screenshot Testing with AndroidUiTestingUtils 2.0.0

DevFeed: [Write Once, Test Everywhere: Cross-Library Screenshot Testing with AndroidUiTestingUtils 2.0.0](<https://devfeed.tech/articles/write-once-test-everywhere-cross-library-screenshot-testing-with-androiduitestingutils-2-0-0-25695.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/write-once-test-everywhere-cross-library-screenshot-testing-with-androiduitestingutils>)

Author: Sergio Sastre Florez

Published: 2023-09-15T15:06:04Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [robolectric](<https://devfeed.tech/tags/robolectric.md>), [roborazzi](<https://devfeed.tech/tags/roborazzi.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

### AI overview

This tutorial explains how AndroidUiTestingUtils 2.0.0 supports cross-library screenshot tests. It describes a common interface for device configuration, the subject under test, and screenshot recording or verification, with separate modules for Paparazzi, Dropshots, Roborazzi, and Shot. It also discusses enabling Robolectric Native Graphics mode through Gradle.

### Source excerpt

As observed in the previous blog post of this series, screenshot tests have a lot in common regardless of the library they're written with, namely: Setting the device configuration (e.g. Locale, Ui Mode, Font scale...) Setting the Subject Under Tes...

## A World Beyond Libraries: Cross-Library screenshot tests on Android

DevFeed: [A World Beyond Libraries: Cross-Library screenshot tests on Android](<https://devfeed.tech/articles/a-world-beyond-libraries-cross-library-screenshot-tests-on-android-25685.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/a-world-beyond-libraries-cross-library-screenshot-tests-on-android>)

Author: Sergio Sastre Florez

Published: 2023-08-23T21:23:13Z

Content type: opinion

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [robolectric](<https://devfeed.tech/tags/robolectric.md>), [roborazzi](<https://devfeed.tech/tags/roborazzi.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [screenshots](<https://devfeed.tech/tags/screenshots.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

An analysis of Android screenshot-testing libraries, comparing JVM-based approaches such as Paparazzi and Roborazzi with on-device tools. It explains trade-offs involving rendering fidelity, emulator reliability, speed, and platform limitations, including fixes in Robolectric 4.12.1.

### Source excerpt

The state of the art of screenshot testing for Android Screenshot testing is trending in Android. Many new libraries have come up, and even Google announced at I/O 20231 that they're working on a new tool for this based on Composable Previews powered...

## Stateful Testing for Android App State Logic

DevFeed: [Stateful Testing for Android App State Logic](<https://devfeed.tech/articles/top-notch-stateful-testing-in-android-25693.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/top-notch-stateful-testing-in-android>)

Author: Sergio Sastre Florez

Published: 2022-08-31T05:59:40Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [test](<https://devfeed.tech/topics/test.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [java](<https://devfeed.tech/tags/java.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [state](<https://devfeed.tech/tags/state.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [view](<https://devfeed.tech/tags/view.md>)

### AI overview

This tutorial explains stateful testing for Android applications by modeling app state, user actions, preconditions, and postconditions. It uses a text editor with text changes, undo, and redo as an example.

### Source excerpt

Broadly speaking, in an app, state is any value that can change over time. All Android apps display state to the user, e.g. an enabled/disabled button, the text displayed in a View, etc. We expect users to modify the state by performing actions throu...

## Android UI screenshot testing across locales, font sizes, orientations, and UI modes

DevFeed: [Android UI screenshot testing across locales, font sizes, orientations, and UI modes](<https://devfeed.tech/articles/design-a-pixel-perfect-android-app-25689.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/design-a-pixel-perfect-android-app-with-screenshot-testing>)

Author: Sergio Sastre Florez

Published: 2022-03-30T05:29:19Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [User experience (UX)](<https://devfeed.tech/topics/ux.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [arabic](<https://devfeed.tech/tags/arabic.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [design](<https://devfeed.tech/tags/design.md>), [language](<https://devfeed.tech/tags/language.md>), [layout](<https://devfeed.tech/tags/layout.md>), [pixel](<https://devfeed.tech/tags/pixel.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>), [ux](<https://devfeed.tech/tags/ux.md>)

### AI overview

This tutorial explains how Android screenshot testing can verify UI correctness across configurations such as locales, font sizes, orientations, and light or dark modes. It also discusses localization concerns including right-to-left layouts, mirrored drawables, and numeral systems.

### Source excerpt

The success of your app depends heavily on its UI/UX. The more popular your app becomes, the more you should care about the diversity of your users. They might speak different languages, suffer from some sort of visual impairment, or feel too much ey...

## UI tests vs. snapshot tests on Android: which one should I write? 🤔

DevFeed: [UI tests vs. snapshot tests on Android: which one should I write? 🤔](<https://devfeed.tech/articles/ui-tests-vs-snapshot-tests-on-android-which-one-should-i-write-25694.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/ui-tests-vs-snapshot-tests-on-android-which-one-should-i-write>)

Author: Sergio Sastre Florez

Published: 2021-12-15T21:03:56Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

### AI overview

This Android testing article explains that UI tests and snapshot tests serve different purposes and should not replace each other. UI tests verify behavior and outcomes after interaction, while snapshot tests verify visual appearance across states and configurations such as themes, languages, font sizes, and screen widths.

### Source excerpt

Snapshot tests on Android have become very popular lately. They run much faster and are easier to write than UI tests if done correctly. For those who've already fought with UI tests and are new to snapshot testing, it's normal to wonder why to still...

## A View-by-View Strategy for Snapshot Testing on Android

DevFeed: [A View-by-View Strategy for Snapshot Testing on Android](<https://devfeed.tech/articles/the-secrets-of-effectively-snapshot-testing-on-android-25692.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/the-secrets-of-effectively-snapshot-testing-on-android>)

Author: Sergio Sastre Florez

Published: 2021-09-23T20:22:08Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

### AI overview

This tutorial presents a view-by-view strategy for snapshot testing Android UI components. It explains why testing individual views can reduce synchronization work, simplify screen-state selection, and make flaky tests easier to diagnose, using a RecyclerView as an example.

### Source excerpt

When one gets started with snapshot testing, there are not enough resources to learn from. It's no surprise to end up with snapshot tests causing a lot of headaches rather than helping improve the quality of our app. One should not snapshot test with...

## An introduction to snapshot testing on Android in 2021 📸

DevFeed: [An introduction to snapshot testing on Android in 2021 📸](<https://devfeed.tech/articles/an-introduction-to-snapshot-testing-on-android-in-2021-25686.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/an-introduction-to-snapshot-testing-on-android-in-2021>)

Author: Sergio Sastre Florez

Published: 2021-08-09T20:07:20Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [espresso](<https://devfeed.tech/tags/espresso.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>), [uiautomator](<https://devfeed.tech/tags/uiautomator.md>)

### AI overview

This introduction explains snapshot testing on Android, also known as screenshot testing. It describes how snapshot tests compare rendered views with stored reference images, how they complement interaction-focused UI tests, and how they can detect visual regressions across commits.

### Source excerpt

Snapshot testing (also called screenshot testing) has been in the Android world for a while, since 8th October 2015, when Facebook open sourced the first version of their snapshot testing library. They are a special type of UI tests that inflate a vi...

## Using Property-Based Testing to Find Password Validator Bugs

DevFeed: [Using Property-Based Testing to Find Password Validator Bugs](<https://devfeed.tech/articles/writing-bulletproof-code-with-property-based-testing-pbt-25696.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/writing-bulletproof-code-with-property-based-testing-pbt>)

Author: Sergio Sastre Florez

Published: 2021-07-07T15:19:35Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Code](<https://devfeed.tech/topics/code.md>), [passwords](<https://devfeed.tech/topics/passwords.md>), [ci](<https://devfeed.tech/topics/ci.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [ci](<https://devfeed.tech/tags/ci.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [password](<https://devfeed.tech/tags/password.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains how property-based testing can complement example-based and parameterised tests. Using a password validator example, it shows how tests may remain green when selected examples fail to cover an implementation error, and how broader valid inputs can expose the bug.

### Source excerpt

In the previous post, we saw how Parameterised Tests help write more focused, concise and scalable tests. However, Parameterised Tests belong to the so-called Example-Based Tests: the tests run only with the input and expected values we choose to pas...

## Better unit tests with Parameterized testing 📈

DevFeed: [Better unit tests with Parameterized testing 📈](<https://devfeed.tech/articles/better-unit-tests-with-parameterized-testing-25688.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/better-unit-tests-with-parameterized-testing>)

Author: Sergio Sastre Florez

Published: 2021-05-31T06:30:38Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Java](<https://devfeed.tech/topics/java.md>), [passwords](<https://devfeed.tech/topics/passwords.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [data](<https://devfeed.tech/tags/data.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [password](<https://devfeed.tech/tags/password.md>), [self-improvement](<https://devfeed.tech/tags/self-improvement.md>), [set](<https://devfeed.tech/tags/set.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>), [verify](<https://devfeed.tech/tags/verify.md>), [writing](<https://devfeed.tech/tags/writing.md>)

### AI overview

This tutorial explains how parameterized or data-driven tests can improve unit-test quantity and quality. Using a password validator as an example, it discusses testing multiple inputs and expected outputs in JUnit 5 with Kotlin, with applicability to Java.

### Source excerpt

While writing Unit Tests, we often verify that given an input, the output of the method under test is the one expected. When you execute the same test with a different set of inputs and expected outputs several times, you come up with Data Driven Tes...

## Styling dynamic strings directly in Android xml

DevFeed: [Styling dynamic strings directly in Android xml](<https://devfeed.tech/articles/styling-dynamic-strings-directly-in-android-xml-25691.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/styling-dynamic-strings-directly-in-android-xml>)

Author: Sergio Sastre Florez

Published: 2021-04-26T09:44:33Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [XML](<https://devfeed.tech/topics/xml.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-apps](<https://devfeed.tech/tags/android-apps.md>), [html](<https://devfeed.tech/tags/html.md>), [ui](<https://devfeed.tech/tags/ui.md>), [user-interfaces](<https://devfeed.tech/tags/user-interfaces.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

This tutorial explains how to style dynamically assembled strings in Android XML resources. It describes the standard placeholder and HTML-markup approach, its limitations when dynamic text contains unescaped HTML characters, and the use of HtmlCompat with escaped placeholder values.

### Source excerpt

In Android, Strings are one of the most common Objects when working with views that show plain text. While implementing user interfaces, it happens often that the text requires some styling. For styled Strings, we are required to use CharSequences in...