SlideShare ist ein Scribd-Unternehmen logo
1 von 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/+

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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/+

Hinweis der Redaktion

  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).