android studio tips

Privacy Policy

Android Studio Tip #6 – Multiple Cursors

I have heard before about this “ability” of Android Studio of having multiple cursors active at the same time, but I haven’t found it very useful until today. You can see what I am talking about in the gif below: Press ALT + SHIFT and left click on the mouse and select the position of […]

, , ,
Privacy Policy

Android Studio Tip #5 – Autocomplete “for” statement

When you want to write a for statement most of you guys (or at least me :P) start to write character by character “for (int i = 0; i < list.size(); i++)”. Well Android Studio makes this easier for us and we can avoid writing that much by using a combination of 2 keys: CTRL

, , ,
Uncategorized

Android Studio Tip #4 – Automatic Negation

Sometimes, (in fact, many times :P) you have to negate boolean expressions, and in order to do that, you write the expression and after that you go back to the beginning to add “!”, am I right? :D Well, you can avoid doing this, by pressing the “!” instead of Enter when you use autocomplete. Just

, , , ,
Uncategorized

Android Studio Tip #3 – Open Class At Specific Line

Did you know that you can open a class at a specific line? This is very useful if you do code reviews and you want to open a specific class to a specific line. Well, Android Studio let us to achieve this by using: To search for a file press: CTRL + SHIFT + N (

, , ,
Uncategorized

Android Studio Tip #2 – Extract Instance Variable

You might need to “convert” a local variable into an instance variable. Well, you can do this very easy with Android Studio. So, in order to extract an instance variable (field) you can do this by using the following shortcut: CTRL + ALT + F (on Windows) or Cmd + ALT + F (on Mac OS)

, , , ,
Uncategorized

Android Studio Tip #1 – Extract Constants

If you have hardcoded strings that should be extracted into constants, you can do that in at least 2 ways: the hard way the EASY way The hard way  is to write yourself the constant and then replace it in the entire code where the string is used. And the EASY way  is to use the power

, , , ,
Scroll to Top