Recently I came across a cool feature in Android Studio called scratch files. Just wanted to share it in Q and A Style.
What are scratch files and how to use them?
What Is Scratch File? A temporary source file. Scratch file isn't considered as a part of our projects and won't be stored in the workspace of the current project. Scratch files are stored in the directory where the android studio is installed on your machine under the `scratches` directory.
Create a scratch fileFrom the main menu, select File | New | Scratch File or press Ctrl+Alt+Shift+Insert . Select the language of the scratch file. Scratch files of the same type are automatically numbered and added to the Scratches and Consoles directory of the Project view. in the gutter or press Shift+F10 .
A scratch file is a temporary computer file which you use as a work area or as a store while a program is operating.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With