Reprint: Android Studio shortcut keys

Source: Internet
Author: User
<span id="Label3"></p><span class="ico ico_type_Translated"><span class="ico ico_type_Translated"><span class="ico ico_type_Translated"> </span></span></span><span class="link_title"><span class="link_title">Android Studio Use Tips series Tutorial (i)</span></span><span class="link_categories"><span class="link_categories">category: Android Studio<span class="link_postdate">2015-07-08 10:04 <span class="link_view" title="阅读次数">4774 People read <span class="link_comments" title="评论次数">comments (6) <span class="link_collect">favorite <span class="link_report">reports</span> </span> </span> </span> </span> </span></span>Android Development Ideandroid-studiotips<p><p>Directory (?) [+]</p></p><p><p>Respect the fruits of labor, reproduced please specify the source: http://blog.csdn.net/growth58/article/details/46729803<br>Follow Sina weibo: @ in Wei<br>Email: [email protected]</p></p><p><p>About me you should know the following two points:<br>1, I am an IDE fanatic<br>2, I am an efficient geek<br>Two years ago, when I turned to IntelliJ Idea,android studio based on it, I spent a lot of time looking for shortcut keys and technologies for more efficient Development. When you see this article, I believe you have done a lot of the same thing, so for you I try to make it easier and faster.</p></p><p><p>In this series of tutorials, we will learn from the most basic development techniques that every developer should know and more advanced skills in Android Studio.</p></p><p><p><strong>about keying Mappings</strong><br>Android Studio provides different key mappings (that is, The mapping between shortcut keys and its corresponding operations), and you can view the currently used keying mappings in the "settings->keymap" menu.<br>It is not practical to list each of the keyed mappings, so the following will be used:</p></p> <blockquote> <blockquote> <p>Windows: <strong>Default</strong><br>Linux: <strong>Default</strong><br>Osx:<strong>Mac OSX 10.5+</strong>(not The default one, it is strongly recommended to use JETBRAINS)</p> </blockquote> </blockquote><strong><strong>jump back and forth</strong></strong><p><p>We spent a lot of time on the code jump and let's try to improve its efficiency.</p></p><strong><strong>open a class</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+o</strong><br>Windows Or Linux: <strong>Ctrl + N</strong></p> </blockquote> </blockquote><p><p>If you have to jump to a class called "<strong>mainactivity</strong>", Just use this shortcut and enter "<strong>MainA</strong>".</p></p><strong><strong>Open a file</strong></strong><p><p>OS X: <strong>cmd+shift+o</strong><br>Windows Or Linux: <strong>ctrl+shift+n</strong><br>Similar to the shortcut key above, but it is all the files that work in the Project. It is very useful for opening androidmanifest.xml or files within the Res/and Assets/folders.</p></p><strong><strong>Open a symbol</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+alt+o</strong><br>Windows Or Linux: <strong>ctrl+alt+shift+n</strong> (translator note: The original is <strong>alt+shift+n</strong>, but this is the other function of the shortcut keys, so Correct)</p> </blockquote> </blockquote><p><p>One is very powerful but a little different than the previous technique: you can jump directly through the search method or variable Name.<br>For example, you know that somewhere in the project there is a method called <strong>getformatteddate ()</strong> that you can use to find it directly.</p></p><p><p><strong>Skills</strong></p></p> <ul> <ul> <li><strong>partial Match</strong><br>You can enter some characters and it can also be matched. For example, to find a class named "<strong>itemdetailfragment</strong>", You can just type "<strong>IDF</strong>" to find it.</li> <li><strong>Line number</strong><br>If your colleague only tells you that a code is in the 22 line of the <strong>excitingclass</strong> class, You can use the shortcut key to open a class to enter the class name with a ":" (colon) appended to it, followed by a line number, such as:<br><strong>excitingclass:22</strong><br>You can also mix partial matches, just like this:<br><strong>Ec:22</strong></li> </ul> </ul><strong><strong>recently opened files</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+e</strong><br>Windows Or Linux: <strong>ctrl+e</strong></p> </blockquote> </blockquote><p><p>This pops up a list of recently opened files</p></p><strong><strong>recently edited files</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+shift+e</strong><br>Windows Or Linux: <strong>ctrl+shift+e</strong></p> </blockquote> </blockquote><p><p>Similar to the above features, but the list is only Modified.</p></p><p><p><strong>Skills</strong></p></p> <ul> <ul> <li>The input characters can be filtered by the List.</li> </ul> </ul><strong><strong>forward or backward</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+alt+left/right</strong><br>Windows Or Linux: <strong>ctrl+alt+left/right</strong></p> </blockquote> </blockquote><p><p>To get a better understanding of this shortcut, you should think about how forward and backward work on a web Browser. Now not on the web page, but in the source code! So when you jump into a code or open a new file, the IDE remembers your previous location and can return quickly.</p></p><strong><strong>Last edited location</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+shift+backspace</strong><br>Windows Or Linux: <strong>ctrl+shift+backspace</strong></p> </blockquote> </blockquote><p><p>This differs from the shortcut key above, which is a jump between the last modified code Location.<br>Imagine that you are modifying a nasty Bug. You think you can fix it and start fixing it, but when you realize that you have to go to the Android source code and other classes in your project, you go into one of the other classes and then jump to another file in 20 steps, you finally finished your fix, but what line are you just editing? Just use this shortcut key and you'll be able to return correctly.</p></p><strong><strong>show where to use</strong></strong><p><p>On a fixed panel</p></p> <blockquote> <blockquote> <p>OS X: <strong>Alt+f7</strong><br>Windows Or Linux: <strong>alt+f7</strong></p> </blockquote> </blockquote><p><p>Show where It's being Used. For a class member variable, it will show where it is used (read and write). For a method, it will show where it was Called. For a class, it will show where the instantiation was Created.<br>You can use the arrow keys and the return keys to view the results in the DISPLAY. You can then use "<strong>Esc</strong>" to return to the editing window.</p></p><strong><strong>show where to use 2</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>Cmd+alt+f7</strong><br>Windows Or Linux: <strong>ctrl+alt+f7</strong></p> </blockquote> </blockquote><p><p>As shown above, it appears in the popup box.</p></p><strong><strong>jump to the place of declaration or implementation</strong></strong><p><p>Here are three shortcut keys to enter a <strong>symbol</strong> :</p></p><strong><strong>Skip to Declaration</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+b</strong><br>Windows Or Linux: <strong>ctrl+b</strong><br>OS X: <strong>Cmd+click</strong><br>Windows Or Linux: <strong>ctrl+click</strong></p> </blockquote> </blockquote><p><p>Jumps to the place where the class, method, or variable is Declared. It is useful to jump to the implementation of classes and methods</p></p><strong><strong>Jump to implementation</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+alt+b</strong><br>Windows Or Linux: <strong>ctrl+alt+b</strong></p> </blockquote> </blockquote><p><p>Lists all <strong>classes/interfaces</strong> implementation-selected <strong>class/interface</strong>. You can also use the method to find <strong>Implemented/overriden</strong>. The variable jumps to the point where it is Declared.</p></p><strong><strong>skip to type declaration</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+shift+b</strong><br>Windows Or Linux: <strong>ctrl+shift+b</strong></p> </blockquote> </blockquote><p><p>When the cursor is on a variable, it jumps to the declaration of the variable Type. For example, the following line of Code:<br><strong>Developer phil = new Developer ("phil");</strong><br>If the cursor is on the "<strong>Phil</strong>" variable, pressing the shortcut key jumps to the declaration of the "<strong>Developer</strong>" class.</p></p><strong><strong>Skip to Parent class</strong></strong> <blockquote> <blockquote> <p>OS X: <strong>cmd+u</strong><br>Windows Or Linux: <strong>ctrl+u</strong></p> </blockquote> </blockquote><p><p>This will open the current <strong>symbol</strong>of the parent class. and the ability to jump to implementation is just the Opposite. If the cursor is on an overridden method, it will open the implementation of the parent class. If the cursor is in a class outside the method or on the class name, it will open the parent class.</p></p><p><p>That ' s all!<br>In the next article, we'll Learn more about shortcut keys.</p></p>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.