SlideShare a Scribd company logo
1 of 10
Handle Multiple Screen Sizes in Android App UI
Design
Raman
Android devices are available in screen sizes and resolutions, Hence multiple screen size in android UI design
is most important.
Screen size : Actual physical size, measured as the screen’s diagonal.For simplicity, Android groups has four
generalized sizes: small, normal, large, and extra large.
Screen density : The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per
inch).For simplicity, Android groups has four generalized densities: low, medium, high, and extra high.
Orientation : The orientation of the screen from the user’s point of view.In Android, This is either landscape
or portrait.
Resolution : Default screen size with with the total number of physical pixels on a screen.In Android, we do
not work directly with resolution; applications should be concerned only with screen size and density
TERMS AND CONCEPTS
Mainly this things done by three ways.
1. Explicitly declare in the manifest which screen sizes your application supports.
2. Provide different layouts for different screen sizes.
3. Provide different bitmap drawables for different screen densities.
1. Explicitly declare in the manifest which screen sizes your application supports
Add the <support-screens> element into the AndroidManifest.xml file. This field specifies which screen size support and
which do not.
<?xml version="1.0" encoding="utf-8"?>
<manifest ..>
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens= "true"
android:anyDensity="true"
/>
<application... >
………..........
</application>
</manifest>
we can also define dp in the <support-screens> element like-
<manifest >
<supports-screens android:requiresSmallestWidthDp="600" />
</manifest>
Mainly this things done by three ways.
1. Explicitly declare in the manifest which screen sizes your application supports.
2. Provide different layouts for different screen sizes.
3. Provide different bitmap drawables for different screen densities.
2. Provide different layouts for different screen sizes
As we design our UI for different screen sizes, we’ll discover that each design requires a minimum amount of space. So,
each generalized screen size above has an associated minimum resolution that’s defined by the system. These
minimum sizes are in “dp” units.
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
We can also define it on the basis of dp like –
res/layout/main_activity.xml // For handsets
res/layout-sw600dp/main_activity.xml // For 7” tablets(600x1024 mdpi).600dp wide and bigger.
res/layout-sw720dp/main_activity.xml // For 10” tablets (720x1280 mdpi).720dp wide and bigger.
Mainly this things done by three ways.
1. Explicitly declare in the manifest which screen sizes your application supports.
2. Provide different layouts for different screen sizes.
3. Provide different bitmap drawables for different screen densities.
3. Provide different bitmap drawables for different screen densities
To set labels for different layouts, dimensions or different screen density resources, use the following resource
directories:
For example:
res/drawable-hdpi/myImg.png // bitmap used for high-density
res/drawable-mdpi/myImg.png // bitmap used for medium-density
res/drawable-ldpi/myImg.png // bitmap used for low-density
res/drawable-xhdpi/myImg.png // bitmap used for extra high density
We can also define it on the basis of dp:
res/layout/main_activity.xml // For handsets
res/layout-sw600dp/main_activity.xml // For 7” tablets(600x1024 mdpi).600dp wide and bigger.
res/layout-sw720dp/main_activity.xml // For 10” tablets (720x1280 mdpi).720dp wide and bigger.
Handing Screen Density
We can develop our application to maintains the physical size of the interface by using match_parent and
wrap_content values for android:layout_width and android:layout_height. This parameter does not specify size but
adapts to the space available.
...
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
...
Bitmap scaling can result in blurry images. To prevent this, provide higher-resolution bitmaps for high-density screens
and the system will use those instead of resizing the bitmap designed for medium-density screens.
Ref:
https://developer.android.com/guide/practices/screens_support.html
https://developer.android.com/training/multiscreen/screendensities.html
And my favorite and obviously other too  :
http://stackoverflow.com
Ask me if any questions , I would love to take it…

More Related Content

Viewers also liked (6)

Jerome Cultrera and Ami Vega Cover Marie Claire Czech
Jerome Cultrera and Ami Vega Cover Marie Claire CzechJerome Cultrera and Ami Vega Cover Marie Claire Czech
Jerome Cultrera and Ami Vega Cover Marie Claire Czech
 
Does music help seniors with arthritis
Does music help seniors with arthritisDoes music help seniors with arthritis
Does music help seniors with arthritis
 
Landlords: Public and Private Partners
Landlords: Public and Private PartnersLandlords: Public and Private Partners
Landlords: Public and Private Partners
 
Donielle Strawder resume Consolidated
Donielle Strawder resume ConsolidatedDonielle Strawder resume Consolidated
Donielle Strawder resume Consolidated
 
M3 game download
M3 game downloadM3 game download
M3 game download
 
Act1 miad
Act1 miadAct1 miad
Act1 miad
 

More from Raman Gowda Hullur (6)

Extent Test report v3 with Appium/Selenium
Extent Test report v3 with Appium/SeleniumExtent Test report v3 with Appium/Selenium
Extent Test report v3 with Appium/Selenium
 
Appium with MySQL Database
Appium with MySQL DatabaseAppium with MySQL Database
Appium with MySQL Database
 
5 Easy Steps to Learn Espresso
5 Easy Steps to Learn Espresso5 Easy Steps to Learn Espresso
5 Easy Steps to Learn Espresso
 
Cucumber with appium
Cucumber with appiumCucumber with appium
Cucumber with appium
 
Advance UIAutomator : Documentaion
Advance UIAutomator : DocumentaionAdvance UIAutomator : Documentaion
Advance UIAutomator : Documentaion
 
How to re sign a android apk file for app testing
How to re sign a android apk file for app testingHow to re sign a android apk file for app testing
How to re sign a android apk file for app testing
 

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Recently uploaded (20)

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 

Handle multiple screen sizes in android app ui

  • 1. Handle Multiple Screen Sizes in Android App UI Design Raman
  • 2. Android devices are available in screen sizes and resolutions, Hence multiple screen size in android UI design is most important. Screen size : Actual physical size, measured as the screen’s diagonal.For simplicity, Android groups has four generalized sizes: small, normal, large, and extra large. Screen density : The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch).For simplicity, Android groups has four generalized densities: low, medium, high, and extra high. Orientation : The orientation of the screen from the user’s point of view.In Android, This is either landscape or portrait. Resolution : Default screen size with with the total number of physical pixels on a screen.In Android, we do not work directly with resolution; applications should be concerned only with screen size and density TERMS AND CONCEPTS
  • 3. Mainly this things done by three ways. 1. Explicitly declare in the manifest which screen sizes your application supports. 2. Provide different layouts for different screen sizes. 3. Provide different bitmap drawables for different screen densities.
  • 4. 1. Explicitly declare in the manifest which screen sizes your application supports Add the <support-screens> element into the AndroidManifest.xml file. This field specifies which screen size support and which do not. <?xml version="1.0" encoding="utf-8"?> <manifest ..> <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens= "true" android:anyDensity="true" /> <application... > ……….......... </application> </manifest> we can also define dp in the <support-screens> element like- <manifest > <supports-screens android:requiresSmallestWidthDp="600" /> </manifest>
  • 5. Mainly this things done by three ways. 1. Explicitly declare in the manifest which screen sizes your application supports. 2. Provide different layouts for different screen sizes. 3. Provide different bitmap drawables for different screen densities.
  • 6. 2. Provide different layouts for different screen sizes As we design our UI for different screen sizes, we’ll discover that each design requires a minimum amount of space. So, each generalized screen size above has an associated minimum resolution that’s defined by the system. These minimum sizes are in “dp” units. res/layout/my_layout.xml // layout for normal screen size ("default") res/layout-small/my_layout.xml // layout for small screen size res/layout-large/my_layout.xml // layout for large screen size res/layout-xlarge/my_layout.xml // layout for extra large screen size res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation We can also define it on the basis of dp like – res/layout/main_activity.xml // For handsets res/layout-sw600dp/main_activity.xml // For 7” tablets(600x1024 mdpi).600dp wide and bigger. res/layout-sw720dp/main_activity.xml // For 10” tablets (720x1280 mdpi).720dp wide and bigger.
  • 7. Mainly this things done by three ways. 1. Explicitly declare in the manifest which screen sizes your application supports. 2. Provide different layouts for different screen sizes. 3. Provide different bitmap drawables for different screen densities.
  • 8. 3. Provide different bitmap drawables for different screen densities To set labels for different layouts, dimensions or different screen density resources, use the following resource directories: For example: res/drawable-hdpi/myImg.png // bitmap used for high-density res/drawable-mdpi/myImg.png // bitmap used for medium-density res/drawable-ldpi/myImg.png // bitmap used for low-density res/drawable-xhdpi/myImg.png // bitmap used for extra high density We can also define it on the basis of dp: res/layout/main_activity.xml // For handsets res/layout-sw600dp/main_activity.xml // For 7” tablets(600x1024 mdpi).600dp wide and bigger. res/layout-sw720dp/main_activity.xml // For 10” tablets (720x1280 mdpi).720dp wide and bigger.
  • 9. Handing Screen Density We can develop our application to maintains the physical size of the interface by using match_parent and wrap_content values for android:layout_width and android:layout_height. This parameter does not specify size but adapts to the space available. ... android:layout_width = "match_parent" android:layout_height = "wrap_content" ... Bitmap scaling can result in blurry images. To prevent this, provide higher-resolution bitmaps for high-density screens and the system will use those instead of resizing the bitmap designed for medium-density screens.
  • 10. Ref: https://developer.android.com/guide/practices/screens_support.html https://developer.android.com/training/multiscreen/screendensities.html And my favorite and obviously other too  : http://stackoverflow.com Ask me if any questions , I would love to take it…