How to use Scratch Files in Android Studio?

Sometimes you may need to create temporary notes or draft up some code outside of the project context. Instead of switching to a different application for this purpose, you can use scratch files and scratch buffers.

To create a scratch file, you can use ALT+CTRL+SHIFT+insert

or on OS X use Command+SHIFT+N

you can read more about it here: docs


It is the same metaphor as a "scratch book", a place to note down useful code fragments or ideas that can be useful to return to later on.


It's a cool feature that lets you save your code that you want to look at later or just for reference.

See this post

Say you are creating a class and you decide to change a section of code. You can create a new scratch file by right clicking on the navigation bar and selection New, and then scratch file. Copy and save the code in the scratch file. This file is not a part of your android studio project.

You can find this file under scratches scope or Scratches folder under Scratches and Consoles folder in Project Scope.

Hope this will interest you guys and help speeding up development.