From the course: Android Studio Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Create and use live templates

Create and use live templates

- [Instructor] Android Studio has something called Live Templates. A live template is essentially an abbreviation that can be expanded to some boiler plate code. Here's an example of a live template that's already built into the product. I'll type logd, and then I'll press the tab key. And that expands to the log.d function call. This is a function that outputs something in what's known as the logcat window. And it's how you would trace what's going on internally at runtime in an Android app. You can modify the existing live templates and create your own. So I'm going to get rid of this code that was generated, and then I'll go to the preferences dialog on Mac or settings on Windows, and look under the editor category and look for live templates. All your live templates are separated in this interface into categories. Anything under the Android category will be coded in Java, not Kotlin. So notice that there's a…

Contents