# Live Templates in Android Studio

DevFeed: [Live Templates in Android Studio](<https://devfeed.tech/articles/live-templates-in-android-studio-25829.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/android-studio-live-templates>)

Author: Segun Famisa

Published: 2025-07-17T06:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [ide](<https://devfeed.tech/topics/ide.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [code](<https://devfeed.tech/tags/code.md>), [ide](<https://devfeed.tech/tags/ide.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [jetbrains](<https://devfeed.tech/tags/jetbrains.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [shortcuts](<https://devfeed.tech/tags/shortcuts.md>), [tests](<https://devfeed.tech/tags/tests.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

This tutorial explains IntelliJ-based IDE live templates, with a focus on creating a custom Android Studio template for Kotlin test functions that use backticks. It describes the template settings, applicable context, abbreviation, description, and template variables.

## Source excerpt

If you are already familiar with live templates, feel free to skip to the live template for kotlin tests If you use IntelliJ-based IDEs like Android Studio, WebStorm, etc., chances are that you have seen some kinds of "shortcuts" (pictured below) show up when you press some key combinations. These are called live templates. For example, if you type sout in a Java/Kotlin file, you see a pop-up like the one above. When you press tab, it autocompletes into System.out.println (in Java) or println in Kotlin. Live templates allow you to generate common code constructs by typing keywords that trigger the template. This feature is not new, and I definitely remember seeing it in the Netbeans IDE when I developed J2ME applications. If, like me, you write a lot of Android code in Android Studio, you may also know that if you type comp in a Kotlin file and press the tab key, a composable function is generated. I have personally found these templates extremely useful for developing faster, and I use them all the time. I even have a few of my own templates, and one of them is the main reason I am writing this article. -- Live Template for Kotlin tests One of the things I do almost every day when I write code is write tests. If you use Kotlin, you might know that backticks are allowed in test function names. I like to optimise my workflow, and I realised this was an opportunity to save myself a few keystrokes for every test I write. I ended up writing a live template to automatically create a test function with backticks (does anyone else find the backtick key awkwardly placed on the keyboard?). To set this up, I follow the instructions on JetBrains' website. You can do the same: CMD + , to open settings Navigate to Editor > Live Templates Select Kotlin group (the templates are usually grouped, but you can also create your own group if you so please) Click on the little + button or CMD + N , and select 1 or Live Template Now we can begin to set the details for the live template. Th