[U] Android Studio – tips & tricks

AS.jpg

Tips & tricks


Visual

  1. Colored Logcat

    What ? – Any type of logs in a different color
    How ?Preferences (Settings on Windows / Linux machines) → Editor → Colors & Fonts → Android Logcat

    Sample colors:

    • Assert #BA68C8
    • Debug #2196F3
    • Error #F44336
    • Info #4CAF50
    • Verbose #BBBBBB
    • Warning #FF9800
  2. Clearing logs

    What ? – Prevention cleaning logs after application crash, view logs from only the chosen package
    How ? – Android Monitor  → Edit filter configuration and type what you want to watch

  3. Code style

    What ? – Set the style code, which you prefer, especially noteworthy is the style: Square and Google
    How ? – Preferences → Code Style → Java and in Scheme, we can choose the style

  4. Split screen

    What ? – Use split screen to work with two or more files
    How ? – Add keyboard shortcut to e.g. Split Vertically  control + alt + v

  5. Distraction Free Mode and Full Screen Mode

    What ? – Use to more space and fewer distractions on screen
    How ? – Enable in toolbar (option View)

  6. Live templates

    What ? – Faster and simply (for, findViewById, inn…)
    How ? – Shortcut ctrl + j


Shortcuts

  1. Search for command

    What ? – Find action by name
    How ? – ctrl + shift + a

  2. Last copy/paste

    What ? – Choose items from last copy/paste
    How ?ctrl + shift + v

  3. Multicursor feature

    What ? – Edit text with more than one cursor (more)
    How ?alt + j

  4. Open a class

    How ?ctrl + n

  5. Open any file

    How ?ctrl + shift + n

  6. Open symbol

    How ?alt + shift + n

  7. Go to implementation

    How ?ctrl + alt + b

  8. Go to declaration

    How ?ctrl + b

  9. Go to type declaration

    What ? – For instance Example example = new Example(); and your caret is on example after this shortcut you will be redirected to Example class
    How ?ctrl + shift + b

  10. Go to super

    What ? – For instance, you override some method and after this shortcut, you will be redirected to the parent method
    How ?ctrl + u

  11. Move between tabs

    How ?alt + <- / -> 

  12. Move between Design/Text tabs in layout’s view

    How ?alt + shift + <- / ->

  13. Close a current tab:

    How ?ctrl + F4

  14. Hide all windows:

    How ?ctrl + shift + F12

  15. Minimalize Android Studio instance

    How ?ctrl + m

  16. Format code

    How ?ctrl + alt + l

  17. Auto-intend lines

    How ? – ctrl + alt + i

  18. Smart Code Completion

    How ? – ctrl + shift + space

  19. Implement methods

    How ? – ctrl + i

  20. Find

    How ? – ctrl + f

  21. Find and replace

    How ? – ctrl + r

  22. Move hardcoded strings to resources

    How ?alt + enter

  23. Build and run

    How ?shift + F10


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s