336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

★안드로이드 스튜디오를 처음 켰을때 뜨는

Android Studio Tips이다.

무시하고 해도되긴하지만 다 도움이 되는 Tips이니 캡쳐해봤다.



★휴대폰 OS 체크법 (▶LINK)




To navigate to the implementations of abstract method,

position the caret at its usage or its name in the declaration and press Ctrl+Alt+B




ctrl+w (=extend selection) in the editor

selects the word at the caret

and then

selects expanding areas of the source code.

For example, it may select a method name,

then the expression that calls this method,

then the whole statement,

then the containing block, etc.

You can also select the word at the caret

and the expanding areas of the source code by double-clicking the target areas in the editor.




The Extract Variable refactoring helps you simplify complicated statements in your code.

For example, in the code fragment below,

you can select an expression in the code:

myEditorPane.setBorder(BorderFactor.createEmptyBorder(5,5,5,5));

and press Ctrl+Alt+v(Refactor | Extract | Variable...).

This will result in the following:



You can comment or uncomment lines and blocks of code using Ctrl+Slash and Ctrl+Shif+slash.




To open your brower with documentation for the element at the editor's caret,

press Shift+F1 (View | External Documentation).




When you need to cast an expression value to the required type

the SmartType code completion will help you.

For example, type

String s = (<caret is here>)

and press Ctrl+Shift+Space to see what happens.





Ctrl+D in the editor duplicates the selected block or the current line

when no block is selected.




Try Live Templates

Live Templates allow you to generate many typical code constructs in seconds!




(코드 자동완성 기능)

The CodeCompletion feature can suggest a name for a variable

when you declare it.

For example, start typing




If the cursor is between the parentheses of a method call,

pressing Ctrl+P brings up a list of valid parameters.




Ctrl+Shift+Backspace (Navigate | Last Edit Location) 

brings you back to the last place

when you made changes in the code.

Pressing Ctrl+Shift+Backspace a few times

moves you deeper into your changes history.




Use Ctrl+Shift+F7 (Edit | Find | Highlight Usages in File)

to quickly highlight usages of some variable in the current file.




Use Code | Reformat Code to reformat code according to your code style preferences

(File | Settings | Code Style).




To see your local history of changes in a file,

invoke Local History | Show History from the context menu.

You can navigate through different file versions,

see the differences and roll back to any previous version.





Press Alt+Q

to see the declaration of the current method without the need to scroll to it.




Ctrl+E

brings a popup list of the recently visited files.

Choose the desired file and press Enter to open it.




Use F2/Shift+F2 keys to jump between highlighted syntax errors.



Use Ctrl+J to complete any valid Live Template abbreviation

if you don't remember it.

For example, type it and press Ctrl+J to see what happens.




To show separator lines between methods in the editor,

open the editor settings

and

select the Show method separators check box

in the Appearance page.





When using basic code completion (Ctrl+Space),

type any characters that exist anywhere in an identifier.



Use Alt+Up and Alt+Down keys to quickly move between mothods in the editor.



Ctrl+Shift+J shortcut joins two lines into one

and

moves unnecessary space to match your code style.





Use Refactor | Copy to create a class which is copy of the selected class.

This can be useful, for example,

when you need to create a class which has much in common with some existing class

and it's feasible to put the shared functionality in a common superclass.



Use the Ctrl+Shift+V shortcut to choose and insert recent clipboard contents

into the text.




To see the inheritance hierarchy for a selected class, 

press Ctrl+H (Navigate | Type Hierarachy).

You can also invoke the hierarchy view right from the editor

to see the hierarchy

for the currently edited class.




Right-clicking on a breakpoint marker (on the bar to the left from the text)

invokes the speedmenu

where you can quickly enable/disable the breakpoint or adjust its properties.




To easily evaluate the value of any expression

while debugging the program,

select its text in the editor 

(you may press a Ctrl+W a few times

to efficiently perform this operation)

and press Alt+F8.




To quickly evaluate the value of any expression

while debugging the program,

hold Alt and click this expression to see its value and calculate it,
call a method, etc.




Use Basic Completion(Ctrl+Space) for completion words in text and comments

in files of many different types.

All the words from the current file that start with the typed prefix will appear in the lookup list.




The shortcut such as Ctrl+Q (View | Quick Documentation),

Ctrl+P (View | Parameter Info),

Ctrl+B (Navigate | Declaration)

and others can be used not only in the editor

but in the code completion popup list as well.




When using code Completion,

you can accept the currently highlighted selection in the popup list

with the period character(.), comma(,), semicolon(;), space and other characters.

The selected name is automatically entered in the editor 

followed by the entered character.



To help you learn the purpose of each item in the main menu,

its short description is shown in the status bar

at the bottom of the application frame

when you position the mouse pointer over this item.




For the pattern search in the Go to Class, Go to Symbol and Go to File popup frames,

use * and space symbols.

* stands for any symbol.

Space at the end means the end of a pattern,




When you invoke the Move refactoring (F6) on an inner class that is declared static,

you are provides with the option to either make it a top-level class,

or move it to another class.



You can use the Extract Variable refactoring

even on incomplete statements.

Just press Ctrl+Alt+V,

and choose the desired expression:






To open any particular method or field in the editor quickly,

press Ctrl+Alt+Shift+N (Navigate | Symbol) and start typing its name.

Choose symbol from the drop-down list that appears.





Use Alt+Shift+C to quickly review your recent changes to the project.





Use Basic Completion (Ctrl+Space) within HTML, CSS and other files,

for completing image file names.





You can start refering to an Ant property or target even if it is not defined yet.

An intention action feature with suggest you to automatically create the necessary teg,

without the need for you to leave your current edition location.




With a single keystroke, you can apply another code style/coloring scheme or keymap

right from the editor.

Just press Ctrl+Back Quote (View | Quick Switch Scheme),

to specify the scheme you want to change.





Use Ctrl+Shift+Enter to complete a current statement such as if, do-while, try-catch, return (or a method call) into a syntactically correct construct

(e.g. add curly braces).



When in the Go to class, Go to Symbol, or Go to File popup,

you can ease the search by filtering the lookup list with the help of the "camel words" prefixes.



Use Ctrl+Shift+I (View | Quick Definition), to quickly review definition or content of the symbol at caret, without the need to open it in a new editor tab.




The Edit | Copy Reference action can be used to insert a reference

to a field/method/class/file

into the current position in the editor.

For example, go to the java.util.Collections JDK class,

place the cursor within the EMPTY_MAP field and press Ctrl+Alt+Shift+C:




The Code | Move Statement Up/Down action is useful for reorganizing the code lines 

in your file, e.g., for bring a variable declaration closer to variable usage.

Select a code fragment and press Ctrl+Shift+Up or Ctrl+Shift+Down.

The following pictures show an initial location of a code fragment,

and the results of moving the selected fragment up and down.


By pressing Alt+Shift+F10

you can access the Run/Debug dropdown on the main toolbar,

without the need to use your mouse.




The Quick Definition Viewer (Ctrl+Shift+I)

can also be used for items in lookup lists

that appear on code completion

and

class/file/symbol navigation commands.



You can use Basic Completion (Ctrl+Space) within Java String literals

and in other file types, for completing .properties keys.




Navigation bar is a quick alternative to the Project view.

Use Alt+Home keyboard shortcut

to show the navigation bar,

and

arrow keys

to locate the necessary files or folders.



The Version Control tool window shows all deleted, modified, and unversioned files

in a single view.

Use keyboard shortcut

to show or hide this tool window.

From the Changes tool window

you can perform all the necessary version control actions :

commit changes, manage changelists,

put resources under version control,

examine differences and more.



If you notice that Android Studio works slowly, 

consider the possibility to reduce the number of folders

under antivirus protection.

Each antivirus check in your project consumes resources.

You can significantly improve the performance,

if you exclude certain folders from the antivirus protection.






If you don't want to commit some of your changes to the repository,

you can set them aside for while, by moving to a separate changelist,

or by putting them to a shelf.

Select such file in the Local tab of the Changes tool window,

and on the context menu choose Move to Another Changelist, or Shelve Changes.




You can bring forward the list of all usage of a class,

method or variable across the whole project,

and quickly jump to the selected usage.

To do that, place the caret at the symbol's name

ot

at its usage in code

and

press Ctrl+Alt+F7 (Edit | Find | Show Usages in the main menu),

scroll the list and click the desired usage.





To quickly find a menu command or toolbar action,

you do not need to look through the menus.

Just press Ctrl+Shift+A

and start typing the name of the action.

Choose the desired action from the suggestion list.




To quickly find and run an inspection,

press Ctrl+Alt+Shift+I

and start typing the name of the inspection

or its group.

Choose the desired inspection from the suggestion list

and then

specify the desired scope.




You can quickly find a setting you need

in the Settings/Preferences dialog,

without browsing through the numerous options.

Just type some characters that, in your opinion,

exist in the option description, and the list of settings will reduce to the matching ones.

Select the desired entry, and see the setting that contains the entered characters highlighted:





You can create code constructs using statement completion.

Start typing a method declaration or statement,

and press Ctrl+Shift+Enter

after the opening parenthesis.

The braces are created, with the caret placed inside:




You can view all methods of the implemented interfaces in a class,

if you place the caret at the implements keyword in the class declaration,

press Ctrl+Shift+F7,

and select the desired interface from the list :





When searching for a text string in a file,

use recent history :

with the search pane already open,

click the down arrow to show the list of recent entries.










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 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 :






Android Studio simplify 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 type-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
to switch between  open files tool windows,




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 X 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 :






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 window 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) twice
and keep it down.
While the key is pressed, the tool window buttons are visible.








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 name  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 show 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 preform search and replace in a file,
pressing Ctrl+F shows the search pane.
Pressing Ctrl+R 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 sertain 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.



To view which line separators style is used in the current file,
look at the Status Bar :






You do not need to open a file in the editor to change its line separator style.
Use the Project tool window instead :
select one or more files, or folders,
point to File | Line Separators on the main menu,
and then choose the desired line ending style.
For directory, new line separator applies recursively.






If you place the caret at certain symbol
and press Ctrl+Alt+Shift+T,
you will see the list of refactorings applicable to the current context.




You want your bookmarks and breakpoints to be always at hand,
so that you can easily navigate through them?
They are visible in the Favorites tool window, which you can dock or float as required :





You can drag an external file from the Explorer or Finder,

and drop it onto the Favorites tool window.



Tune the Android Studio tool windows layout

to make better use of your screen.

Toggle between the vertical and side-by-side placement of the tool windows by Ctrl+Click/Cmd+Click on the splitter :


You don't need to leave Android Studio

to work with your favorite shell.

Just click the Terminal tool window button,

and enjoy using the embedded local terminal.



For the embedded local terminal,

you can define your favorite shell,

default tab name, 

and other settings.

Choose File | Settings on the main menu, and then open the page Terminal.



Enable the horizontal scrolling with the mouse wheel by holding the Shift key.




Android Studio allows you to search through the classes, files, tool windows,

actions, settings, and symbols of your project

by double pressing the Shift key.



When using autopopup Code Completion,

you can select the first item using Ctrl+Period.

The selected name is automatically entered in the editor followed by dot.



When an autopopup completion is active,

Ctrl+Down and Ctrl+Up will close it and move the caret down or up in the editor.



When in the Code Completion lookup,

you can ease the search by filtering the list with the help of the "camel words" prefixes.



Pressing the same shortcut after you have invoked Smart-type Completion

when there's an array of expected type in context will suggest to get an element 

from this array.



Pressing the same shortcut after you have invoked Smart-type Completion

when a collection type is expected will search for arrays with same component type and suggest to convert them using Arrays.asList() call.



Pressing the same shortcut after you have invoked Smart-type Completion

will search for chained expressions which have expected type.



When using Code Completion,

you can accept the currently highlighted selection in the popup list with the Ctrl+Shift+Enter,

Android Studio will not just insert the selected string,

but also will do its best to turn current code construct into syntactically correct one

(balance parentheses, add missing braces and semicolons, etc)


When using Code Completion in Java,

you can accept the currently highlighted selection in the popup list with the exclamation sign (!) character.

It will be inserted before the boolean method or variable you were completing,

thus negating the whole expression.



To quickly complete a method call of static method located anywhere in your project, libraries or JDK,

enter a prefix and press Ctrl+Space twice.

You'll see all the matching methods.

If you want the method you chose to be imported statically,

press Alt+Enter and see what happens.


Posted by ElectricShock
:
BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백