Presentation Assistant
To demonstrate which keyboard shortcuts are being used throughout this article, we are using the Presentation Assistant plugin:We've compressed all shortcuts and tricks from the article into a printable cheatsheet. Download it here.
Action search
One of the most exciting things about IntellyJ IDEs is an action search tool. With this tool you can find by name and perform any action. There is a dialog window to show you what keyboard shortcut you can use for this action (a perfect cheat sheet!):
Quick switch scheme
Whether you’re practicing pair programming, or simply sharing a computer with another developer, chances are that you don’t have the same keymap and/or layout preferences in the Android Studio. In this case, to make your workflow more convenient you can:- Export your and your colleague’s keymaps and other settings with Action Export Settings
- Import them in the AS on the machine that you are both going to be working on
- Use Quick Switch Scheme dialog to fluently switch between your keymaps

Non-distraction Mode
Ok, so you open Android Studio and what you usually see is something like this:


Multicursor
One of the coolest things in Android Studio, (and other IDEA-based IDEs) is the Multicursor feature. It enables you to create multiple carets inside the active editor. In having control over all of them at once you can not only input the same text in multiple places, but you can also do everything you could with one regular caret. Documentation on MulticursorLive templates
It's much more simple to demonstrate this than to describe it. Live templates are used in scenarios like the following:- You type an abbreviation
- Press Enter
- ...Magic…
- Full code structure (`fori` -> full for loop structure)
Postfix operations
With postfix operations you can perform refactoring operations without highlighting and refactoring quick list. You just type . after structure and choose operation from methods autocompletion list. That really saves time! Documentation on Postfix operationsClipboard buffer
Android Studio remembers all your copy-pastes...
Scratch buffer
Every time you need to open an external text editor just to edit some text before pasting it into a code editor, you should use a scratch buffer. You can easily create a new buffer with the “Find command by name” dialog. Also, when you close the buffer you always can reopen it with the “Recently edited files” panel. In addition to this feature AS also has a scratch files function. The main difference between scratch buffers and files is that with files you can choose the syntax of an edited text and editor will correctly highlight it. Documentation on Scratch bufferTesting
You can easily create or navigate to test with Go To: Test in the context menu (right click in the editor) or via a shortcut (Cmd+Shift+T is the default). If the file does not exist, Android Studio will show you a dialog to create it, where you can choose what framework to use (JUnit3, JUnit4, and there is even Spock option) and where to place it, as there are separate folders for unit tests (test) and Android Instrumentation tests (instrumentationTests). To create new tests, you can use the Generate menu (Cmd+N), and select Test Method. This will insert a new test method from the template, including all the boilerplate code like @Test annotation, throws Exception in signature and even test prefix in the method name. This means you don’t have to write it yourself and risk forgetting something. You can always modify or add new templates in preferences. Something else to bear in mind, if you are practicing TDD, and generally choose to constantly switch between test code and implementation (though you can do it with cursor history Cmd+[ , Cmd+] ), you can split your current editor horizontally or vertically and open implementation in one and tests in another split view. [caption id="attachment_13215" align="aligncenter" width="740"]
Language Injection
There is a cool feature called Language Injection. It is not only reduced to regular expression; you can also inject languages like JSON and SQL (in IDEA Ultimate Edition). With this feature you can inject language in a string, edit a fragment in a separate editor while IDE will put all escaping and transformations needed in the original string. With having caret over the string literal, you can use Intentions: Inject Language or reference and select the language you need. Besides the injection feature, Studio can also assist you with regexp check: just call intention dialog in a string with a regular expression and choose “Check RegExp”. Documentation on Language injectionGroovy Console
Groovy Console is a useful tool when you need to run some code snippets to check whether something works as expected, without building a whole project or writing tests (which may be unrelated to your code). You can open it with Find Action: Groovy Console. Documentation on Groovy consoleLogcat

Android Studio JRE version
Android Studio is able to use different Java versions. This is important for Mac OS X users because:- With Java 6, fonts are rendered with antialiasing, but not in Java 7+
- Secured updates cannot work with Java 6
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk $ open /Applications/Android\ Studio.appSo, if you are OK with new fonts - use new Java, it’s a bit safer. You can find more details here
Summary
Android Studio is a really powerful IDE that contains dozens of extremely useful tools, but they can only help you if you know about them :) We’ve collected a small list of videos that will inspire you with new discoveries:- Android Studio for Experts (Android Dev Summit 2015)
- IntelliJ IDEA Tips and Tricks Full Version
- IntelliJ IDEA: 42 Tips and Tricks
- (About) 10 Things You (Probably) Didn’t Know You Could do in Android Studio
Subscribe to updates
Share this article