Android – Easily Debuggable Layout XML files

Hello Folks,
Everyday, New android apps come up with beautiful designs. All these screens are baked with the help of xml tags. Developers use dummy values in their TextView while they create their layouts with android:text field of TextView. But we cannot leave these dummy text values while we release the final app. Because, It creates a risk of unintentionally showing the dummy data to the user.
I have recently seen a small, But an useful piece of tip in the Android Studio series of videos in google developer youtube channel.

So,
Add –

xmlns:tools="http://schemas.android.com/tools"

to your root layout and then add the dummy text content to any TextView like this,

   <Textview
     ...
     ...
     tools:text="My Dummy Text"
     />

this dummy text will be shown inside the textview only when you open the layout in android studio to help you out. It will not be shown in the compiled app. Hope this simple tip saves some time in debugging and modifying layouts.

Reference : https://www.youtube.com/watch?v=K2dodTXARqc

Thanks,
Balachandar KM

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