Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Two Android Studio Productivity Tips You Must Know

DZone's Guide to

Two Android Studio Productivity Tips You Must Know

Get the most from your IDE to get your app out to the public sooner

· Mobile Zone
Free Resource

Launching an app doesn’t need to be daunting. Whether you’re just getting started or need a refresher on mobile app testing best practices, this guide is your resource! Brought to you in partnership with Perfecto

This post will handle two of the frequent tasks that you'll find yourself doing in Android Studio

  • Modifying layout XML files
  • Observing logcat output
Modifying layout XML files

When modifying XML layout files, one has to decide the ultimate decision, whether to use the design or text view


The design view provides a good visual presentation of the layout. However, the text view provides faster property control and is easier to edit. So eventually, one would find themselves switching back and forths between those tabs.

Fortunately, you can have them both and gain productivity!

Choose the Text tab and you would see a collapsed "Preview" text on the right side of the IDE (see image below)

It will open a small preview tab slider on the right. Every change that is done in the Text tab will be reflected immediately in the preview.  Every element you will select in the preview will highlight the relevant element in the Text view.

This is how this dual view would be presented: 


Android Studio Text and Visual Preview on the same view

Observing Logcat Output

Logging into logcat is one of the basic fundamentals every Android developer uses. It is very useful to trace application output and trace execution.

Often one would compare log output from 2 sessions in order to find differences. Android Studio has a built-in tool for that, which will make the comparison super-fast.

The first step is to select the first output you want to compare and copy it to the memory (i.e. Cntl+C).

The image below shows a sample selection & copy from a logcat:

The second step is to filter logcat to present the latest run (you don't have to use filter, just make sure it is visible in the logcat) , select it and right-click on the selection. 

In the context menu you will see an option to compare the selected text with the clipboard.


Right Click context menu on selection

Choose this option and you will see a diff tool.  


Android Studio Diff tool
That's it. Hope you will find it useful.

Please include this link to the original post.

Keep up with the latest DevTest Jargon with the latest Mobile DevTest Dictionary. Brought to you in partnership with Perfecto.

Topics:
android studio

Published at DZone with permission of Nico Vermeir, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}