SlideShare uma empresa Scribd logo
1 de 12
Ravi Vyas
• Android Developer, Project Manager at Techjini Solution
  Pvt Ltd
• Co-Organizer of the Bangalore Android User Group
• Creator of the Blrdroid logos
•   Screen size
•   Screen density
•   Orientation
•   Resolution
• Phones are not always

• Android phones flavors :
     • Different screne sizes
     • Different screen densities


• Always have a design plan for both portrait and
  landscape :
• Landscape != Portrait + Δwidth - Δheight
• Use the <supports-screens> tag in the manifest to
  specify which screens you plan to support
• <supports-screens
           android:smallScreens="true"
           android:normalScreens="true"
           android:largeScreens="true"
           android:xlargeScreens="true“ />
• You can provide different resources & layouts based on
  various factors like screen size , screen pixel density ,
  orientation etc

       layout-land
       layout-port

       res-hdpi
       res-mdpi

   Android will handle changes by itself

• Manually handle configuration changes
    onConfigurationChanged(Configuration newConfig)
    android:configChanges="keyboard|orientation"
•   Do not use PX to specify size
•   Use rules for placement for pixel distances
•   Rethink, recheck your rules .
•   Check how alignParentLeft/Right will look on other
    screens
• 9 Patches
• XML Drawables

   <item android:id="@android:id/background">
      <shape>
        <corners android:radius="15dip" />
        <gradient
            android:startColor="#ff9d9e9d"
            android:centerColor="#ff5a5d5a"
            android:centerY="0.75"
            android:endColor="#ff747674"
            android:angle="270"
        />
      </shape>
   </item>
• While designing the UI enter real sample data to better
  visualize the UI.
• When displaying numbers , use the largest possible
  number to test
• Don’t trust emulator.
• Test on as many devices as possible.
• Motodev Studio – Device Anywhere
• contact@ravivyas.co
  m
• @ravivyas84
• Ravivyas.com/+

Mais conteúdo relacionado

Mais procurados

Designing Android apps for multiple screens
Designing Android apps for multiple screensDesigning Android apps for multiple screens
Designing Android apps for multiple screensAbhijeet Dutta
 
UX and UI Designing for all android screen
UX and UI Designing for all android screenUX and UI Designing for all android screen
UX and UI Designing for all android screenArnold Saputra
 
Adaptive Design for Android
Adaptive Design for AndroidAdaptive Design for Android
Adaptive Design for AndroidNi Yan
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia toolsShona Hira
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia toolsDom Mike
 
Designing for Android - Anjan Shrestha
Designing for Android - Anjan ShresthaDesigning for Android - Anjan Shrestha
Designing for Android - Anjan ShresthaMobileNepal
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能Unity Technologies Japan K.K.
 
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザインUnite2017Tokyo
 
High DPI for desktop applications
High DPI for desktop applicationsHigh DPI for desktop applications
High DPI for desktop applicationsKirill Grouchnikov
 

Mais procurados (9)

Designing Android apps for multiple screens
Designing Android apps for multiple screensDesigning Android apps for multiple screens
Designing Android apps for multiple screens
 
UX and UI Designing for all android screen
UX and UI Designing for all android screenUX and UI Designing for all android screen
UX and UI Designing for all android screen
 
Adaptive Design for Android
Adaptive Design for AndroidAdaptive Design for Android
Adaptive Design for Android
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia tools
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia tools
 
Designing for Android - Anjan Shrestha
Designing for Android - Anjan ShresthaDesigning for Android - Anjan Shrestha
Designing for Android - Anjan Shrestha
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
 
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
 
High DPI for desktop applications
High DPI for desktop applicationsHigh DPI for desktop applications
High DPI for desktop applications
 

Semelhante a Creating apps that work on all screen sizes

How to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidHow to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidSittiphol Phanvilai
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando Gallego
 
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...mstonis
 
Beating Android Fragmentation, Brett Duncavage
Beating Android Fragmentation, Brett DuncavageBeating Android Fragmentation, Brett Duncavage
Beating Android Fragmentation, Brett DuncavageXamarin
 
Cross Device UI Designing
Cross Device UI DesigningCross Device UI Designing
Cross Device UI DesigningDeepu S Nath
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013Marc D Anderson
 
Design guidelines for android developers
Design guidelines for android developersDesign guidelines for android developers
Design guidelines for android developersQandil Tariq
 
Android training day 3
Android training day 3Android training day 3
Android training day 3Vivek Bhusal
 
Etsy - Android & Design
Etsy - Android & DesignEtsy - Android & Design
Etsy - Android & DesignDeniz Veli
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1Edureka!
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 
Application Development - Overview on Android OS
Application Development - Overview on Android OSApplication Development - Overview on Android OS
Application Development - Overview on Android OSPankaj Maheshwari
 
responsive awareness
responsive awarenessresponsive awareness
responsive awarenessonehundred_be
 
Rwd Testing Baiju Joseph
Rwd Testing Baiju JosephRwd Testing Baiju Joseph
Rwd Testing Baiju JosephvodQA
 
RWD Testing - Baiju Joseph
RWD Testing - Baiju JosephRWD Testing - Baiju Joseph
RWD Testing - Baiju JosephThoughtworks
 
Lecture 4 display_principles
Lecture 4 display_principlesLecture 4 display_principles
Lecture 4 display_principlesmoduledesign
 
Windows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsWindows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsOliver Scheer
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 

Semelhante a Creating apps that work on all screen sizes (20)

How to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidHow to deal with Fragmentation on Android
How to deal with Fragmentation on Android
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...
Xamarin Evolve 2014 - Designing Android UIs for the Ever Changing Device Land...
 
Beating Android Fragmentation, Brett Duncavage
Beating Android Fragmentation, Brett DuncavageBeating Android Fragmentation, Brett Duncavage
Beating Android Fragmentation, Brett Duncavage
 
UI and UX for Mobile Developers
UI and UX for Mobile DevelopersUI and UX for Mobile Developers
UI and UX for Mobile Developers
 
Cross Device UI Designing
Cross Device UI DesigningCross Device UI Designing
Cross Device UI Designing
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
Design guidelines for android developers
Design guidelines for android developersDesign guidelines for android developers
Design guidelines for android developers
 
Android training day 3
Android training day 3Android training day 3
Android training day 3
 
Etsy - Android & Design
Etsy - Android & DesignEtsy - Android & Design
Etsy - Android & Design
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Application Development - Overview on Android OS
Application Development - Overview on Android OSApplication Development - Overview on Android OS
Application Development - Overview on Android OS
 
divide and qonquer
divide and qonquerdivide and qonquer
divide and qonquer
 
responsive awareness
responsive awarenessresponsive awareness
responsive awareness
 
Rwd Testing Baiju Joseph
Rwd Testing Baiju JosephRwd Testing Baiju Joseph
Rwd Testing Baiju Joseph
 
RWD Testing - Baiju Joseph
RWD Testing - Baiju JosephRWD Testing - Baiju Joseph
RWD Testing - Baiju Joseph
 
Lecture 4 display_principles
Lecture 4 display_principlesLecture 4 display_principles
Lecture 4 display_principles
 
Windows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 ApplicationsWindows Phone 8 - 2 Designing WP8 Applications
Windows Phone 8 - 2 Designing WP8 Applications
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 

Mais de Ravi Vyas

What Product Market Fit is not
What Product Market Fit is notWhat Product Market Fit is not
What Product Market Fit is notRavi Vyas
 
Mobile Metrics and Analytics
Mobile Metrics and AnalyticsMobile Metrics and Analytics
Mobile Metrics and AnalyticsRavi Vyas
 
Key User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementKey User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementRavi Vyas
 
Android workshop
Android workshopAndroid workshop
Android workshopRavi Vyas
 
Why android first
Why android firstWhy android first
Why android firstRavi Vyas
 
Android v 1.1
Android v 1.1Android v 1.1
Android v 1.1Ravi Vyas
 
Know thy code
Know thy codeKnow thy code
Know thy codeRavi Vyas
 

Mais de Ravi Vyas (8)

What Product Market Fit is not
What Product Market Fit is notWhat Product Market Fit is not
What Product Market Fit is not
 
Mobile Metrics and Analytics
Mobile Metrics and AnalyticsMobile Metrics and Analytics
Mobile Metrics and Analytics
 
Key User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementKey User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & Engagement
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Why android first
Why android firstWhy android first
Why android first
 
Android v 1.1
Android v 1.1Android v 1.1
Android v 1.1
 
Know thy code
Know thy codeKnow thy code
Know thy code
 
Android
AndroidAndroid
Android
 

Último

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Creating apps that work on all screen sizes

  • 2. • Android Developer, Project Manager at Techjini Solution Pvt Ltd • Co-Organizer of the Bangalore Android User Group • Creator of the Blrdroid logos
  • 3. Screen size • Screen density • Orientation • Resolution
  • 4. • Phones are not always • Android phones flavors : • Different screne sizes • Different screen densities • Always have a design plan for both portrait and landscape : • Landscape != Portrait + Δwidth - Δheight
  • 5. • Use the <supports-screens> tag in the manifest to specify which screens you plan to support • <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true“ />
  • 6. • You can provide different resources & layouts based on various factors like screen size , screen pixel density , orientation etc layout-land layout-port res-hdpi res-mdpi Android will handle changes by itself • Manually handle configuration changes onConfigurationChanged(Configuration newConfig) android:configChanges="keyboard|orientation"
  • 7. Do not use PX to specify size • Use rules for placement for pixel distances • Rethink, recheck your rules . • Check how alignParentLeft/Right will look on other screens
  • 9. • XML Drawables <item android:id="@android:id/background"> <shape> <corners android:radius="15dip" /> <gradient android:startColor="#ff9d9e9d" android:centerColor="#ff5a5d5a" android:centerY="0.75" android:endColor="#ff747674" android:angle="270" /> </shape> </item>
  • 10.
  • 11. • While designing the UI enter real sample data to better visualize the UI. • When displaying numbers , use the largest possible number to test • Don’t trust emulator. • Test on as many devices as possible. • Motodev Studio – Device Anywhere
  • 12. • contact@ravivyas.co m • @ravivyas84 • Ravivyas.com/+

Notas do Editor

  1. Screen size Actual physical size, measured as the screen&apos;s diagonal.For simplicity, Android groups all actual screen sizes into 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 example, a &quot;low&quot; density screen has fewer pixels within a given physical area, compared to a &quot;normal&quot; or &quot;high&quot; density screen.For simplicity, Android groups all actual screen densities into four generalized densities: low, medium, high, and extra high.Orientation The orientation of the screen from the user&apos;s point of view. This is either landscape or portrait, meaning that the screen&apos;s aspect ratio is either wide or tall, respectively. Be aware that not only do different devices operate in different orientations by default, but the orientation can change at runtime when the user rotates the device.Resolution The total number of physical pixels on a screen. When adding support for multiple screens, applications do not work directly with resolution; applications should be concerned only with screen size and density, as specified by the generalized size and density groups.Density-independent pixel (dp)A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way.The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a &quot;medium&quot; density screen. At runtime, the system transparently handles any scaling of the dp units, as necessary, based on the actual density of the screen in use. The conversion of dp units to screen pixels is simple: px = dp * (dpi / 160). For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. You should always use dp units when defining your application&apos;s UI, to ensure proper display of your UI on screens with different densities
  2. One of the biggest thing stopping you for supporting all screens is that most people think of the phone as a candy bar , so much so that a rectangle with the small dot at the bottom is considered an icon for a phone.Android is open source thus there are so many options with so many different configurationsIts totally fine to have different layouts for landscape, so much so that you may decide to hide some components
  3. Lets you specify the screen sizes your application supports and enable screen compatibility mode for screens larger than what your application supports. It&apos;s important that you always use this element in your application to specify the screen sizes your application supports. if your application does not work well when resized to fit different screen sizes, you can use the attributes of the &lt;supports-screens&gt; element to control whether your application should be distributed to smaller screens or have its UI scaled up (&quot;zoomed&quot;) to fit larger screens using the system&apos;s screen compatibility mode.
  4. For orientation changes make sure you handle the orientation changes . Default orientation change restarts the activity
  5. PX does not scale for different screen sizesA center aligned wrapcontent image will look fine a small screen but as the screen size increases the empty space on the left and rigth will increaseDensity-independent pixel (dp)A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way.The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a &quot;medium&quot; density screen. At runtime, the system transparently handles any scaling of the dp units, as necessary, based on the actual density of the screen in use. The conversion of dp units to screen pixels is simple: px = dp * (dpi / 160). For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. You should always use dp units when defining your application&apos;s UI, to ensure proper display of your UI on screens with different densities
  6. They also save size
  7. &lt;size        android:width=&quot;integer&quot;        android:height=&quot;integer&quot; /&gt;    &lt;solid        android:color=&quot;color&quot; /&gt;    &lt;stroke        android:width=&quot;integer&quot;        android:color=&quot;color&quot;        android:dashWidth=&quot;integer&quot;        android:dashGap=&quot;integer&quot; /&gt;android:centerXFloat. The relative X-position for the center of the gradient (0 - 1.0).android:centerYFloat. The relative Y-position for the center of the gradient (0 - 1.0).
  8. &lt;size        android:width=&quot;integer&quot;        android:height=&quot;integer&quot; /&gt;    &lt;solid        android:color=&quot;color&quot; /&gt;    &lt;stroke        android:width=&quot;integer&quot;        android:color=&quot;color&quot;        android:dashWidth=&quot;integer&quot;        android:dashGap=&quot;integer&quot; /&gt;android:centerXFloat. The relative X-position for the center of the gradient (0 - 1.0).android:centerYFloat. The relative Y-position for the center of the gradient (0 - 1.0).
  9. &lt;size        android:width=&quot;integer&quot;        android:height=&quot;integer&quot; /&gt;    &lt;solid        android:color=&quot;color&quot; /&gt;    &lt;stroke        android:width=&quot;integer&quot;        android:color=&quot;color&quot;        android:dashWidth=&quot;integer&quot;        android:dashGap=&quot;integer&quot; /&gt;android:centerXFloat. The relative X-position for the center of the gradient (0 - 1.0).android:centerYFloat. The relative Y-position for the center of the gradient (0 - 1.0).
  10. &lt;size        android:width=&quot;integer&quot;        android:height=&quot;integer&quot; /&gt;    &lt;solid        android:color=&quot;color&quot; /&gt;    &lt;stroke        android:width=&quot;integer&quot;        android:color=&quot;color&quot;        android:dashWidth=&quot;integer&quot;        android:dashGap=&quot;integer&quot; /&gt;android:centerXFloat. The relative X-position for the center of the gradient (0 - 1.0).android:centerYFloat. The relative Y-position for the center of the gradient (0 - 1.0).