# 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...