{"id":325984,"date":"2010-02-16T08:30:08","date_gmt":"2010-02-16T13:30:08","guid":{"rendered":"http:\/\/www.androidguys.com\/?p=13405"},"modified":"2010-02-16T08:30:08","modified_gmt":"2010-02-16T13:30:08","slug":"handling-multiple-screen-sizes-part-one","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/325984","title":{"rendered":"Handling Multiple Screen Sizes, Part One"},"content":{"rendered":"<div class=\"KonaBody\">\n<p class=\"first-child \"><em><a rel=\"attachment wp-att-10675\" href=\"http:\/\/www.androidguys.com\/2009\/11\/09\/return-of-the-fancy-listviews\/buildingdroids\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-10675\" title=\"BuildingDroids\" src=\"http:\/\/www.androidguys.com\/wp-content\/uploads\/BuildingDroids.jpg\" alt=\"\" width=\"225\" height=\"150\" \/><\/a>This is the first part of a several part series on handling multiple screen sizes in your Android projects. This material is adapted from a chapter in <a href=\"http:\/\/commonsware.com\/Android\/\">The Busy Coder&#8217;s Guide to Android Development, Version 3.0<\/a>.<\/em><\/p>\n<p>For the first year or so since Android 1.0 was released, all production Android devices had the same screen resolution (HVGA, 320&#215;480) and size (around 3.5&#8243; \/ 9cm). Starting in the fall of 2009, though, devices have been arriving with widely disparate screen sizes and resolutions, from tiny QVGA (240&#215;320) screens to much larger WVGA (480&#215;800) screens.<\/p>\n<p>Of course, users will be expecting your application to be functional on all of these, and perhaps take advantage of larger screen sizes to add greater value. To that end, Android 1.6 added new capabilities to help better support these differing screen sizes and resolutions.<\/p>\n<p>The Android documentation has <a href=\"http:\/\/d.android.com\/guide\/practices\/screens_support.html\">extensive coverage<\/a> of the mechanics of handling multiple screen sizes. These blog posts are designed to complement that coverage.<\/p>\n<p>Let&#8217;s suppose, though, that you start off by totally ignoring the issue of screen sizes and resolutions. What happens?<\/p>\n<p>If your application is compiled for Android 1.5 or lower, Android will assume your application was designed to look good on the classic screen size and resolution. Android will then automatically do the following:<\/p>\n<ul>\n<li>If your \tapplication is installed on a device with a larger screen, Android \twill run your application in &#8220;compatibility mode&#8221;, scaling \teverything based on the actual screen size. So, suppose you have a <span style=\"font-family: Consolas,courier;\">24px<\/span> square PNG file, and Android install and runs your application on a \tdevice with the standard physical size but a WVGA resolution (a \tso-called &#8220;high-density&#8221; screen). Android might scale your \tPNG file to be <span style=\"font-family: Consolas,courier;\">36px<\/span> when it displays it, so it will take up the same visible space on \tthe screen. On the plus side, Android handles this automatically; on \tthe minus side, bitmap scaling algorithms tend to make the images a \tbit fuzzy.<\/li>\n<li>Android \twill block your application from running on a device with a smaller \tscreen. Hence, QVGA devices, like the HTC Tattoo, will be unable to \tget your application, even if it is available on the Android Market.<\/li>\n<\/ul>\n<p>If your application is compiled for Android 1.6 or higher, Android assumes that you are properly handling all screen sizes, and therefore will not run your application in &#8220;compatibility mode&#8221;.<\/p>\n<p>The next post in the series will begin providing tips for how to design layouts that will work independent of resolution.<\/p>\n<\/div>\n<h3  class=\"related_post_title\">Might We Suggest&#8230;<\/h3>\n<ul class=\"related_post\">\n<li><a href=\"http:\/\/www.androidguys.com\/2010\/02\/08\/comparing-android-kindle-app-development\/\" title=\"Comparing Android and Kindle for App Development\">Comparing Android and Kindle for App Development<\/a><br \/><small>The Amazon Kindle is getting an SDK and &#8220;app store&#8221;. Learn a bit more about how these compare to Android in today&#8217;s episode of Building &#8216;Droids!&#8230;<\/small><\/li>\n<\/ul>\n<p><a href=\"http:\/\/feedads.g.doubleclick.net\/~a\/KIeOfbtI9cbLvUGB9U4rNDEmn4M\/0\/da\"><img decoding=\"async\" src=\"http:\/\/feedads.g.doubleclick.net\/~a\/KIeOfbtI9cbLvUGB9U4rNDEmn4M\/0\/di\" border=\"0\" ismap=\"true\"><\/img><\/a><br \/>\n<a href=\"http:\/\/feedads.g.doubleclick.net\/~a\/KIeOfbtI9cbLvUGB9U4rNDEmn4M\/1\/da\"><img decoding=\"async\" src=\"http:\/\/feedads.g.doubleclick.net\/~a\/KIeOfbtI9cbLvUGB9U4rNDEmn4M\/1\/di\" border=\"0\" ismap=\"true\"><\/img><\/a><\/p>\n<div class=\"feedflare\">\n<a href=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?a=C7gpMEphLkk:70miDC4Il5E:D7DqB2pKExk\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?i=C7gpMEphLkk:70miDC4Il5E:D7DqB2pKExk\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?a=C7gpMEphLkk:70miDC4Il5E:gIN9vFwOqvQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?i=C7gpMEphLkk:70miDC4Il5E:gIN9vFwOqvQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?a=C7gpMEphLkk:70miDC4Il5E:yIl2AUoC8zA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?d=yIl2AUoC8zA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?a=C7gpMEphLkk:70miDC4Il5E:qj6IDK7rITs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?d=qj6IDK7rITs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?a=C7gpMEphLkk:70miDC4Il5E:6swKnRFnXgo\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/androidguyscom?i=C7gpMEphLkk:70miDC4Il5E:6swKnRFnXgo\" border=\"0\"><\/img><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/androidguyscom\/~4\/C7gpMEphLkk\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the first part of a several part series on handling multiple screen sizes in your Android projects. This material is adapted from a chapter in The Busy Coder&#8217;s Guide to Android Development, Version 3.0. For the first year or so since Android 1.0 was released, all production Android devices had the same screen [&hellip;]<\/p>\n","protected":false},"author":703,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-325984","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/325984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/703"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=325984"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/325984\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=325984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=325984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=325984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}