But this ad space

9 Things You Didn’t Know You Could Do in Android Studio

Photo of author
Written By Naman Modi

If you are wondering what an Android Studio is? Well, Android is the most popular Android development tool in the world today and that is due to its ease of use.

What makes the Android platform great is the reliable tools used to develop its apps. Among them is the popular Android Studio.

This mobile development tool is the official IDE (Integrated Development Environment) for the Android platform, which was designed by Google and used to make the most of its apps used in the market today.

If you are an expert in Android development then you know that this is the most reliable tool to develop Android apps. The beauty of this tool is that each upgraded version comes with advanced capabilities.

This post highlights some of the things you probably didn’t know you could do with Android Studio while developing your apps.

At the end of it, it will help you better understand the studio and you eventually become a better Android developer.

1. Manage Clipboard

Many Android developers don’t know that Android Studio allows them to manage the contents of their clipboards.

While developing your apps, you copy and cut a lot of code snippets as you move codes around the studio from one method to the other.

You can only paste the last item you copied by default. This process is simplified by Android Studio which lets you decide which of all your copied items you wish to paste.

Also, by default, the depth of the clipboard is five and you can therefore only view the last five items you copied. This tool allows you to extend the depth to any length that you choose.

To view all the copied items from your list using Android Studio, press Ctrl +Shift + V for Windows. If you are using Linux on Mac, press Cmd + Shift+ V. This will show you the last five copied items and you can pick the ones you want to be pasted.

2. Modify logcat display

Another awesome thing that that you didn’t know that you can do with your android studio is the customization of logcat to display messages in different colors in different log categories.

This option is meant to help you get a very daunting task done given that there are tons and tons of log messages to scroll through.

The default setting only allows you to simply search for what we are looking for. This lacks the effectiveness we need to carry out these tasks.

With Android Studio you can customize colors for different log message categories, which makes it easier and simple to work with the logcat.

To customize the logcat colors, click on File >> Settings >> Colors & Fonts >> Android Logcat and follow the instructions.

3. Create String resources from hardcoded Strings

I bet you didn’t know that you can hardcode Strings in your studio to create resources with just keyboard commands.

The majority of developers don’t always go to resources to define Strings first when typing codes.

If you are one of them you should know that Android will highlight all the hardcoded strings and prompt you to add them as resources. Doesn’t this make your code look untidy?

Another thing is that the process can wear you down especially if there are hundreds of them.

Fortunately, when you are using Android Studio, with a keyboard command, you can migrate them to resources directly from the file where you defined them.

On windows, you can do this by first ensuring that the caret is on the text you want to move to resources then press alt + Enter, while on Mac it is option + return.

4. Persist logcat data when the app crashes

9 Things You Didn't Know You Could Do in Android Studio

Android Studio also allows you to keep the data of your current app in the logcat even after it crashes. Errors and sudden crashes while developing your apps are a norm and can’t be avoided.

When this happens, it’s a bomber since a lot of valuable information about the current session gets lost.

Fortunately, there is a way to avoid this mess but quite a few of us know about it. To do this in your Android Studio, open Logcat and navigate to the show only selected application menu and click the dropdown.

Select Edit filter configuration from the dropdown menu. A menu will pop up where you’ll type in a filter name and your application package name.

Once done, click Ok.

5. Multi cursor selection

You probably didn’t know that you can select multiple texts in Android Studio and act on them all at once.

To apply changes on two or more exact words to update or delete them on the fly is awesome for any software developer.

You can do this flawlessly using Android Studio.

To select and effect multiple texts in Android Studio on windows, highlight one instance of the desired text that you want to apply changes on and press alt + j.

You can also do this on Mac by pressing control + g and type the changes you want to be made.

6. Live templates

Another thing that Android Studio allows you to do access to live code templates.

This is done by using PostFix code completion to transform an already typed expression into another one.

Using a live template and postFix code completion is one of the easiest ways to speed up development time.

This is a great feature that allows you to generate a bunch of code snippets depending on your context. You can use shortcuts that are available as autocomplete options using Live Templates.

These templates will insert templatized snippets into your code. To implement live templates, start by either typing the entire codeword by word, or press Ctrl + j on windows.

If you are using, press Mac Cmd + j and it will pop up a list of the available code templates in that context.

7. postFix code completion

postFix code completion can also be used to transform an already typed expression into another one.

However, live templates allow us to insert some of the most common code patterns into our work with quick shortcuts.

When dealing with repetitive codes like for-loops, if-else statements, this is very handy.

8. Move between design and text tabs

I bet you didn’t know that you can switch tabs in between Design and Text in the layout view.

When you are still developing your Android app, you often navigate between the design and text tabs for several reasons.

This requires mousing through these tabs most of the time when you want to switch every single time.

This also requires a keyboard shortcut. 

Android Studio: Conclusion 

Most of the time we get tools but fail to go deep into them to find out what other secrets they hold in making our mobile app development faster and easier.

I must confess that it’s not our fault since some of these things are not included in the manual. However, you should always be on your toes and try to explore these mobile development tools.

Android Studio is a great tool and can help you do a lot more in your mobile development. These are not the only things that are hidden and you can also discover something new.

Disclaimer. The views and opinions expressed here are those of the authors. They do not purport to reflect the opinions or views of IdeasPlusBusiness.com. Any content provided by our bloggers or authors is of their opinion and is not intended to malign any organization, company, individual, or anyone or anything.

For questions, inquiries and advert placements on the blog, please send an email to the Editor at ideasplusbusiness[at]gmail[dot]com. You can also follow IdeasPlusBusiness.com on Twitter here and like our page on Facebook here. This website contains affiliate links to some products and services. We may receive a commission for purchases made through these links at no extra cost to you.