Common Shortcut keys
Code to jump
Description: Jump is to facilitate the location of code, there are two kinds of jump: at the definition can jump to the call, at the call can jump to the definition.
Shortcut:Cmd + mouse click
Method jump
Description: Jump from a class method to a nearby class method.
Shortcut:Ctrl + Up/Down
Forward and backward position navigation
Description: Move the cursor to before or after editing history.
Shortcut keys: Front:Cmd + ]
After:Cmd + [
Automatic code completion
Description: Completion can speed up our coding speed.
Shortcut:Cmd + Shift + Enter
The problem to repair
Description: Quick fix for problematic code.
Shortcut:Alt + Enter
Class lookup
Description: Find the class in the project
Shortcut:Cmd + o
File search
Description: Find files in the project
Shortcut:Cmd + Shift + o
Any search
Description: Find files, classes, and actions in the project
Shortcut:Shift + Shift
Column selection
Description: The default is row selection mode.
Shortcut:Alt + left mouse button + drag
Code error location
Description: Quickly locate the error.
Shortcut:F2
Show/hide all Windows
Description: When the code editing window is too small, you can hide the relevant Windows such as the Project panel.
Shortcut:Shift + Cmd + F12
Returns to the code editing window
Description: Returns without mouse when the focus is not in the code edit window.
Shortcut:esc
Recent documents
Description: Displays recently browsed or edited files.
Shortcut:cmd + e
和 cmd + shift + e
Class elements quickly locate
Description: Floating window display class structure, through the input of key words to complete fast positioning.
Shortcut:cmd + F12
Parameter information
Description: Displays method parameter information.
Shortcut:cmd + p
rename
Description: Rename field and method names.
Shift + f6 [image upload failed…(image-792648-1624852233004)]
Live Template
Description: Live Template can save us a lot of things.
Shortcut:Cmd + J
Jumps to the specified location
Description: Locate to the specified row or column
Shortcut:Cmd + L
Take a quick look at function definitions
Description: A Popup window appears
Shortcut:Cmd + Y
These are some of the most commonly used keyboard shortcuts. If you want to learn more about them, check out the best Android Studio Shortcuts and Tips.
Common plug-in
GsonFormat
GsonFormat can not be displayed by pressing Alt+S after installing the plugin. If you have similar problems, please change the shortcut key. I changed the shortcut key to Ctrl+F12.
Download: github.com/zzz40500/Gs…
ParcelableGenerator
In Android, there are two ways to serialize, respectively, is to implement Serializable interface and Parcelable interface, but in Android is recommended to use Parcelable, but this way is more complicated than Serializable. So with this plugin everything is ok.
Download: github.com/mcharmas/an…
CodeGlance
Can be used to quickly locate code, similar to the location view on the right side of the Sublime editor.
Download: github.com/Vektah/Code…
Android WiFi ADB
Is it annoying to debug your app often by plugging in and out of USB? The charging port of your phone can be damaged easily after a long time. Use this plug-in to debug your app over WiFi. The method is very simple, the steps are as follows:
-
First, make sure your computer and phone are on the same wifi LAN
-
For the first time, connect the cable to your computer and make sure your device is visible to Android Monitors. The diagram below:
-
Open the Android WiFi ADB panel and clickConnectAfter the button, you can unplug the data line.
When the data cable is unplugged, “No devices Connected” is displayed in the “Android WiFi ADB” panel, but our device will still be displayed in the “Android Monitors”. All subsequent operations will be the same as when we connected the data cable.
Download: github.com/pedrovgs/An…
What is Instant Run?
Instant Run is a feature of Android Studio 2.0, and with this feature, Android Studio has made a quantum leap in the speed at which applications can be compiled.
-
Previous Compilation process
-
Compilation process after 2.0
Since 2.0, Android Studio has selectively used hot Swap, Warm Swap, code Swap and other compilation schemes to speed up compilation.
After running the application for the first time, there is a lightning bolt next to the running triangle, indicating that Instant Run is now ready to use.
hot swap
Just change the internal code or instructions of the method, Android Studio will adopt the Hot Swap solution, the whole compilation and deployment is very fast.
Note: The default Hot Swap mode will also restart Activey, you need to go to the Settings, as shown below:
warm swap
In the case of modifying or deleting resources, Android Studio will adopt a warm swap scheme and you can see Activey being restructured.
cold swap
The whole process of Cold Swap took a little longer. Android Studio automatically recorded every change we made to our project and uploaded the change to the phone as a dex. The entire app was then restarted and the new dex was reloaded.
series
Android Studio2.0 tutorials from getting started to mastering MAC version – learn how to get started with Android Studio2.0
For Android Studio2.0, you can go from beginner to master for MAC — www.open-open.com/lib/view/op…