Best practices for text on Android
summary
Overview of concrete Android text practices: Minikin does shaping, line breaking and a system LRU word-measure cache of 5,000 items; hyphenation costs about 2.5× more CPU and depends on locale so use setTextLocale/LocaleSpan. Use premeasured text (PrecomputedText.create) off‑UI to cut measure cost ~90%, prefer SpannableStringBuilder for >250 spans, avoid XML autolink in RecyclerView (precompute Linkify/LinkifyCompat), use SpannableFactory to avoid copies, and use async Smart Linkify and the built‑in Magnifier for selection.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 5:31Text styling
- 12:54Internationalized text
- 14:07Layout
- 19:33Measure
- 27:06Set Text
- 29:49AutoLink
related talks
37mAndroid Text, The Good The Bad and The ugly
43mBest Practice for Text on Android and Its Internals
36mBest practices for using text in Android
15mUse Android text like a pro
46mTypesetting: designing and building beautiful text layouts
41mAndroid Textual Layout
23mThe lesser-known world of Spans
40mWhat's New (?) in Android Text Over the Past Few Years
