2018년 4월 16일 월요일

Android Studio tips of the day except image part.

You can view all statements within the method where certain exceptions can be caught. Just place the caret at the throws keyword in a method declaration, press Ctrl+Shift+F7 and select the desired exception class from the list. This will also work for try and catch.


When you press Alt+Enter to invoke a quick fix or intention action, press the right arrow key to reveal the list of additional options.
Depending on the context, you can choose to disable inspection, fix all problems, change inspection profile, etc.




Ctrl+Click (on Windows) or Cmd+Click (on MacOS) a tab in the editor to navigate to any part of the file path. Select the necessary element in the drop-down, and the corresponding file path opens in an external browser (e.g., in the Explorer, if your OS is Windows).




Android Studio lets you jump from your check-in comment to an issue in your task tracker.
All you have to do is to define issue navigation patterns in the Settings | Version Control | Issue Navigation dialog:

When you commit a changelist, and type the check-in comment, make sure it matches one of your issue navigation patterns. Later, when you browse through the changelists in the repository, such comments turn into hyperlinks:

Clicking a hyperlink brings you directly to an issue in your task tracker.




Android Studio simplifies your work with colors in Android resource files. The color properties have the icons of the corresponding color in the left gutter area of the editor.
Click color icons to choose the desired color from the color picker.




Android Studio helps create test cases directly from class declaration. With the caret at the class name in the editor, press Alt+Enter, and choose Create Test from the suggestion list:




You can easily make column selection by dragging your mouse pointer while keeping the Alt key pressed.



You don't need to guess which index.html file you are looking at...
Make the editor tabs and lines in navigation lists stand out using the File Colors page of the project settings.




If nothing is selected in the editor, and you press Ctrl+C, then the whole line at caret is copied to the clipboard.



You can move any file to a changelist of your choice. To do that, just choose Move to Another Changelist on the file context menu in the Version Control tool window:




Keep your source code typo-free with the help of the built-in Spellchecker.
All texts, including comments, textual strings and literals, are inspected against the pre-defined dictionaries. All typos are highlighted, which leaves you with the task of choosing the correct word, accepting the current spelling, or disabling inspection.
Use Alt+Enter to see the list of available actions.



If you lack words in the pre-defined dictionaries, you can create your own ones. A custom dictionary is a mere textual file with a .dic extension, with each word starting on a new line.
All you have to do is to point to the directories where your dictionaries are stored, in the Spelling of the Settings dialog.



All your most indispensable VCS commands are just one-click away...
Choose VCS | VCS Operations Popup on the main menu, and get a popup with the VCS commands that are relevant to the current context:



Use the Switcher (Ctrl+Tab) to switch between open files and tool windows. Keeping Ctrl pressed, use the Up and Down arrow keys, Tab or Shift+Tab, Alt for navigation; use Delete or BackSpace to close editor tab or hide a tool window.




You can easily open an external file for editing, if you just drag it from the Explorer or Finder to the editor.




There are two ways of closing all tabs in the editor, except the current one:
First, right-click the editor tab, and choose Close Others on the context menu.
Second, keeping the Alt key pressed, click   on the editor tab.




You can jump directly to any deeply buried file, if you press Ctrl+Shift+N, and type just a couple of characters of the enclosing directories and file names:

Use either a slash or a backslash as a delimiter.



To open any class or file in the editor at the desired line, press Ctrl+Shift+N (Navigate | File), start typing the name, and choose the one from the suggestion list. Then type the colon (:) and a line number.
The selected file will open with the caret at the specified line.



Version control annotations show the latest changes of each line in one click.
Just right-click an annotation and use the Show Diff command in the context menu.



To compare two directories, select one or both of them in the Project view and press Ctrl+D.


To compare two jar files, select one or both of them in the Project view and press Ctrl+D.



If you need more workspace, you can hide the tool windows bars: click   in the lower left corner.
If necessary, you can show the tool window buttons just for a moment. To do that, press the key Alt (for Windows/*nix) or Command (for Mac) twice and keep it down. While the key is pressed, the tool window buttons are visible.




You can exclude any file from your project. As a result, such a file will be ignored by indexing, inspection and code completion.
In the Project tool window, select the file you want to ignore, and choose Mark as plain text in its context menu.
If necessary, you can always return the file to its original type using the Mark as <file type> context menu command.



When using basic code completion (Ctrl+Space), you don't need to type upper-case letters in CamelHump names. It is enough to type the initial letters of the camel names in lower case, and they will be smartly recognized.




The keyboard shortcut Ctrl+K enables you to quickly invoke the Commit Changes dialog.
This dialog shows all modifications in project, gives summary information of file status and suggests improvements before check-in.


It is very easy to toggle between find and replace functionality.
When you perform search and replace in a file, pressing Ctrl+F shows the search pane. Pressing Ctrl+H adds field, where you can type the replace string.
While in the Find in Path dialog, you can switch to replace by pressing Ctrl+Shift+R. Same way, press Ctrl+Shift+F to hide the Replace with field, and switch to mere search.



If you are working on a large project, with numerous TODO items, filter them by scopes.
Use the Scope-Based tab in the TODO tool window to show only those items that pertain to the scope of interest.



TODO tool window lets you preview each of the encountered TODO items - just click the preview button on the toolbar.

 



If a method signature has been changed, Android Studio highlights the tags that ran out of sync with the documentation comment and suggests a quick fix:
 

When working with a lengthy list of tasks, you don't need to delete them one by one. Select several tasks, using Shift or Control/Command keys, click the right arrow, and then click Remove.
 

If there are too many run/debug configurations of the same type, you can group them into folders, and thus distinguish them visually.
 

In the Live Templates settings, use speed search to find templates with certain text in the template abbreviation, body or description.
Start typing the desired text, and the list of available templates will shrink to show matching templates only:
 

You can avoid escaping backslashes in your regular expressions. Start typing a regular expression, then press Alt+Enter and choose Edit RegExp. The regular expression opens in a separate tab in the editor, where you can type backslashes as is.
All changes are synchronized with the original regular expression, and escapes are presented automatically. When ready, just press Escape to close the regular expression editor.
 

댓글 없음:

댓글 쓰기

국정원의 댓글 공작을 지탄합니다.

프로그래밍 면접 질문

SAX/DOM 프로세스와 스레드 Activity/Fragment 사용해본 개발환경이 무엇인지 답하기 알고리즘의  big O O(log n), O(n), O(n * log n), O(n2...