Post has attachment
Android Studio Tip of the Day: Toggle between text/design mode

Turns out that you can quickly toggle between the ui designer and the xml editor in with ctrl+shift+left/right on OSX and alt+shift+left/right on windows and linux.

#androidstudioprotip #tipoftheday #android #article #gde
Photo

Post has attachment
Pair programming with somebody who has a different keymap? Try Quick Switch Scheme "ctrl+`" (that's the control key plus the back quote)

#androidstudioprotip #tipoftheday #android #article #gde
Animated Photo

Post has attachment
Quick android studio tip: Enable "CamelHumps" words in "Editor->General->Smart Keys" to navigate in method and field names with the "alt" or "ctrl" key.

#androidstudioprotip #tipoftheday #android #article #gde
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: Use the Tab Key in Search Everywhere

Search everywhere is interesting: you only have to double tap the shift key and it will show you matching classes, files, symbols and even actions! However, if you want to select a method, you'll find it in the third category so you will end up pressing the down key many times.

One cool trick is to use the tab key to navigate quickly between sections. The first tab will get you to the "more" button so that you can expand the current category. The next time you press the tab key will get you to the next category.

#androidstudioprotip #tipoftheday #android #article #gde
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: Navigate to a File in a Specific Folder

You might already know that you can quickly open a file by typing "cmd+shift+o" on the mac and "ctrl+shift+n" on Windows/Linux (and if you didn't know, now you do!). The problem is that a given file name can appear in multiple folders! An example of that would be "dimens.xml". If we search for "dimen", we can see it appear in many folders like values, values-sw600dp, values-sw720dp... and a probably a bunch more. After that we take a good hard look at the 10 identical files with different folder, find the one that we want then press the down key a bunch of times until we get to the file that we want.

Turns out that there is a better way to zero in on the file that you want! You can prefix the name of the path (don't forget to put you forward slash "/") and android studio will filter it for you! E.g. to find the values-sw720dp/dimens.xml, you could type "sw720dp/d". But since android studio supports partial matching, you could rewrite the previous search query as "s7/d" and you would probably end up with only the file that you were looking for!

#androidstudioprotip #tipoftheday #android #article #gde
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: tools:attribute

If you have ever entered some testing text in a TextView to see how it looks in the previewer, then this is for you.
For any attribute in the xml that has the pattern 'android:something="value"', you can add a new attribute named 'tools:something="value"' and it will be picked up by the previewer but ignored in your app. Then you can leave default values that makes sense to visualize the layout without impacting the final build. 

Two things that you should check using the tools namespace:
  1) Text that will be set at runtime (so that you don't try to visualize an empty layout)
  2) Stuff that is dynamically changed later (e.g. visibility)

To configure the tools namespace, put this in the root tag of your layout (under the android xmlns):
  xmlns:tools="http://schemas.android.com/tools"

#androiddev #protip #androidstudioprotip
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: Extract Resource

When you hardcode a string or a dimen, it is pretty easy to extract it to the correct resource files.
Just invoke the show intention actions (quick fix) panel on the string or dimen and let the IDE do the boring work for you.
It will ask you in which file(s) you want to put it and in which source set if you are using flavors.


Shortcut: Alt + Enter → Extract String/Dimension Resource 

#androiddev #protip #androidstudioprotip
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: Memory Monitor

This thing will plot a graph of the memory consumption over time of a specific app for a specific android device/emulator.
Just navigate through your app and look at it. If the graph always go up and never falls down, it might be a sign that you have a memory leak.

Shortcut: 
  Menu: Tools → Android → Memory Monitor
  Toolbar: Memory Monitor

#androiddev #protip #androidstudioprotip
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: The Navigation Bar

The navigation bar is the "breadcrumb" at the top of the IDE.
It shows you the path to the current file but you can also use it to navigate and/or take action on files and folders.

Interesting stuff:
  - You can navigate to any subfolder from a parent or find sibling classes
  - You can create new files easily using the code generation shortcut (cmd+n / alt+insert)
  - In fact, you can do anything that you could do by right-clicking in the project view
  - When you know the shortcut, you can hide the bar and gain a little bit of screen real estate.

Shortcut: 
  - Mac: Cmd+Up
  - Windows/Linux: Alt+Home
Animated Photo

Post has attachment
Android Studio / Intellij Tip of the Day: Close Others

If you have a bunch of tabs opened, this will close them all except the current one.
there are two ways to do this:
  1) Right click the tab and select "Close Others"
  2) Hold the "Alt" key and click on the "x" on the tab

#androiddev #protip #androidstudioprotip
Animated Photo
Wait while more posts are being loaded