# Android Studio Tips and Tricks

DevFeed: [Android Studio Tips and Tricks](<https://devfeed.tech/articles/android-studio-tips-and-tricks-25102.md>)

Original publisher: [Read original article](<http://michaelevans.org/blog/2016/01/06/android-studio-tips-and-tricks/>)

Author: Michael Evans

Published: 2016-01-07T01:25:53Z

Content type: tutorial

Language: en

Sources: [Gadget Habit](<https://devfeed.tech/sources/gadget-habit.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [code-completion](<https://devfeed.tech/topics/code-completion.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [code-completion](<https://devfeed.tech/tags/code-completion.md>), [development](<https://devfeed.tech/tags/development.md>), [json](<https://devfeed.tech/tags/json.md>), [productivity](<https://devfeed.tech/tags/productivity.md>), [shortcuts](<https://devfeed.tech/tags/shortcuts.md>), [tips-and-tricks](<https://devfeed.tech/tags/tips-and-tricks.md>)

## AI overview

A practical guide to Android Studio and IntelliJ features that improve coding productivity, including language injection for JSON and regular expressions, context-aware type completion, the Productivity Guide, and IntelliJ's REST client.

## Source excerpt

I recently attended Google's Android Dev Summit where the Tools team presented a talk entitled Android Studio For Experts. The room was packed for the 90 minute session, where a lot of great Android Studio tips were shared. This gave me the idea of showing off some of my favorite Android Studio tips! Language Injection Ever needed to type a JSON String? Perhaps you've used one as a text fixture for one of your GSON deserializers and know that it's a huge pain to manage all those backslashes. Fortunately, IntelliJ has a feature called Language Injection, which allows you to edit the JSON fragment in its own editor, and then IntelliJ will properly inject that fragment into your code as an escaped String. Inject Language/Reference is an intention action1, so you can start it by using ⌥+Return, or ⌘+⇧+A and searching for it. Check RegExp This is pretty similar to the last tip, but if you select the language of the fragment as "RegExp", you'll get a handy regular expression tester! Smart(er) Completion Now I'm pretty sure most of you have used IntelliJ's code completion features. Press ⌥+Space, and IntelliJ/Android Studio lists options to complete the names of classes, methods, fields, and keywords within the visibility scope. But have you ever noticed that the suggestions seem to be based off the characters you've typed, rather than the actual types that are expected in the scope of the caret? Something like this: Well if you use Type Completion (by pressing ⌥+⇧+Space), you will see a list of suggestions containing only those types that are applicable to the current context. In the example below, you'll only get types that return a Reader, which is the type that the BufferedReader's constructor expects: What's even cooler is that you can press it an additional time, and IntelliJ will do a deeper scan (looking at static method calls, chained expressions, etc.) to find more options for you: Discovering Your Own Tips and Tricks Another really cool feature is the Productivi