Android Basics : Phone vs Tablet – Screen specific Layouts

Most of the time your App will have a different layout on a Phone vs a Tablet. On a device with a larger screen, like a Tablet, you will want to use the extra space.

In your Employee App it will be better to display only list of Employees on a Phone. While on a Tablet you can display Employee List and Employee Details side by side.

So how can you achieve this ?

In Android you can have resources like Layouts, Images etc. specific to Screen Size, Orientation and Aspect Ratio. For this you need to create specific folder and then place the
resource in that.

For example you need to create two layout xml files. One for Phone and one for Tablet. For this you need to create a layout-large folder and put the tablet layout file in that.

The options you have can be categorized into –

Resource Type – Screen Size – Screen Density – Orientation – Aspect Ratio

Resource Type can be layout, menu etc.

Screen Size can be small, normal, large, xlarge

Screen Density can be ldpi, mdpi, hdpi etc.

Orientation can be land, port.

Now you can create folders using these parameters like layout-large.

Follow the video to understand this better.

Author: androidsmartly

I am a Tech Enthusiast who likes to work on new Ideas. Sharing knowledge on Android, Marketing, Startups and More.

1 thought on “Android Basics : Phone vs Tablet – Screen specific Layouts”

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