SlideShare une entreprise Scribd logo
1  sur  53
Working with Multiple Screens Make Your Android UI Rock Everywhere
Suzanne Alexandra Android Developer Advocate, Motorola @suzalex http://moto.ly/samples © 2010 Motorola Mobility, Inc. All rights reserved except as otherwise explicitly indicated.
Why does it matter?
Make users happy Extend your reach
Size really mattersPause  &  Watch DialingWandhttp://moto.ly/dialingwand
Key Point #1Choose your target devices
Android 1.5? QVGA? Global? As of November 2010, developer.android.com
FLIPOUT DROID PRO DROID X
Comparing resolution DROID X480 x 854 Normal DROID PRO320 x 480 Normal FLIPOUT320 x 240 Small
Comparing resolution DROID XHigh240 dpi DROID PROMedium160 dpi FLIPOUTLow120 dpi
Key Point #2Start with a fewsimple guidelines.
Pause the slides  & watch the PhotoDemo video on YouTube
Adjust your AndroidManifestfor versions and screen sizes.
<uses-sdk android:minSdkVersion= "7"  		       android:targetSdkVersion= "8" />
<supports-screens 		     android:largeScreens= "true"              android:normalScreens="true"              android:smallScreens="true"              android:anyDensity="true" />
But be careful ,[object Object]
  Test thoroughly on your targetSdkVersion
  Make sure you don't get size compatibility mode,[object Object]
BonusScreen orientation and performance
Use adaptable measurements,like dip and sp.
Low 1 dip = 0.75 pixels High 1 dip = 1.5 pixels Medium 1 dip = 1 pixel What’s a DIP? A pixel that changes size
Pause the slides &  Watch the RelativeLayout video on YouTube
Use one set of images andlet Android scale them, for now. But we’ll look at this more later.
Key Point #3 Add custom resources as needed, but watch performance.
Add custom layouts, if you need them.But you might not.
Choose an image strategy ,[object Object]
  Custom resource sets for low, medium, and high density?
  Target the most commonly used density?
  Retrieve images dynamically at runtime and handle?,[object Object]
150% for high 100% for normal 75% for low
Memory vs file size PhotoOne	 32 MBmemory                            	 324 KB size  PhotoThree	 23 MBmemory 728 KB size
In other words Autoscaling uses memory.Custom image sets increase file size.
What happens if you load a really big image 				into a small view?
You might get  No image Or a memory error
Your application UI can behave differently across devicesor in different conditionsdue to memory
Pause the slides &  Watch the handling images video on YouTube
private Bitmap loadBitmap() {      	DisplayMetrics metrics = new DisplayMetrics();     	getWindowManager().getDefaultDisplay().getMetrics(metrics); int screenDensity = metrics.densityDpi;     	BitmapFactory.Options options = new BitmapFactory.Options();     	options.inJustDecodeBounds = false; options.inSampleSize = 4;     	options.inScaled = true; options.inTargetDensity = screenDensity;     	Bitmap bitmap = BitmapFactory.decodeResource(getResources(),  			            R.drawable.clover, options);     	return bitmap;  }
If you need to detect density at runtimeandroid.util.DisplayMetricsis cool
Pause the slides &Watch the detecting device density video on YouTube
240 and 1.5 120 and 0.75 160 and 1.0
public void checkDensity()  {       DisplayMetrics metrics = new DisplayMetrics();       getWindowManager().getDefaultDisplay().getMetrics(metrics); 	   String logical_density = Float.toString(metrics.density);       Log.e (TAG, "Logical density is " + logical_density); 	    // for API level 4 (Android 1.6) and forward       String screen_density = Integer.toString(metrics.densityDpi);       Log.e (TAG, "Screen density is " + screen_density); }
Key Point #4 Touch and gesture are key. Make sure they’re density independent too.
Pause the slides &Watch the buttons video on YouTube
<ImageButton 	android:id="@+id/button"  	android:src="@drawable/button"  	android:clickable="true"  	android:layout_gravity="center_vertical|center_horizontal"  android:layout_width="wrap_content"      	android:layout_height="wrap_content" 	android:background="@null" android:padding="40dip" />
16 pixels 3.3 mm 1.7 mm 2.5 mm
private static final float DISTANCE_DIP = 16.0f; private static final float PATH_DIP = 40.0f;  // convert dip measurements to pixels  final float scale = getResources().getDisplayMetrics().density;  scaledDistance = (int) ( DISTANCE_DIP * scale + 0.5f );  scaledPath = (int) ( PATH_DIP * scale + 0.5f );
Okay .. Remember the key points?
Once again … ,[object Object]

Contenu connexe

Tendances

09 tolerancia do dia metro do furo
09 tolerancia do dia metro do furo09 tolerancia do dia metro do furo
09 tolerancia do dia metro do furoAilton Rios
 
Chumbador fisher dados técnicos
Chumbador fisher dados técnicosChumbador fisher dados técnicos
Chumbador fisher dados técnicosAluizio Alves
 
05 enclosures
05 enclosures05 enclosures
05 enclosurespsize web
 
Uji metalorgrafi
Uji metalorgrafiUji metalorgrafi
Uji metalorgrafiandikaarmy
 
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...Ari Satriadi Helmi
 
Tabla especificacion tuberia
Tabla especificacion tuberiaTabla especificacion tuberia
Tabla especificacion tuberiaK-rlox Erazo
 
NORSOK STANDARD_L-005.docx
NORSOK STANDARD_L-005.docxNORSOK STANDARD_L-005.docx
NORSOK STANDARD_L-005.docxKCMSpecialSteel
 
Elastomeros etileno acrilato_metila_vamac
Elastomeros etileno acrilato_metila_vamacElastomeros etileno acrilato_metila_vamac
Elastomeros etileno acrilato_metila_vamacBorrachas
 
Fusca - "Manual vw-1300-1500"
Fusca - "Manual vw-1300-1500"Fusca - "Manual vw-1300-1500"
Fusca - "Manual vw-1300-1500"Luiz Avelar
 
Lista de dureza dos parafusos e porcas
Lista de dureza dos parafusos e porcasLista de dureza dos parafusos e porcas
Lista de dureza dos parafusos e porcasrafaelnun
 
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕES
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕESPARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕES
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕESSandro Marques Solidario
 
Mengelas listrik dasar bu hettyk
Mengelas listrik dasar bu hettykMengelas listrik dasar bu hettyk
Mengelas listrik dasar bu hettykHettyk Sari
 
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...Joab Soares Ferreira
 
Apostila arco submerso
Apostila arco submersoApostila arco submerso
Apostila arco submersoOkutagawa
 
Tabela roscas
Tabela roscasTabela roscas
Tabela roscasjcjaneiro
 

Tendances (20)

09 tolerancia do dia metro do furo
09 tolerancia do dia metro do furo09 tolerancia do dia metro do furo
09 tolerancia do dia metro do furo
 
Chumbador fisher dados técnicos
Chumbador fisher dados técnicosChumbador fisher dados técnicos
Chumbador fisher dados técnicos
 
05 enclosures
05 enclosures05 enclosures
05 enclosures
 
5 mesh control (2)
5 mesh control (2)5 mesh control (2)
5 mesh control (2)
 
Uji metalorgrafi
Uji metalorgrafiUji metalorgrafi
Uji metalorgrafi
 
Peralatan Las gas Metal (MIG/MAG)
Peralatan Las gas Metal (MIG/MAG)Peralatan Las gas Metal (MIG/MAG)
Peralatan Las gas Metal (MIG/MAG)
 
Manual lavador
Manual lavadorManual lavador
Manual lavador
 
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...
Laporan Praktikum Teknik Las Ari Satriadi Helmi (Teknik Mesin Universitas Ind...
 
Tabla especificacion tuberia
Tabla especificacion tuberiaTabla especificacion tuberia
Tabla especificacion tuberia
 
NORSOK STANDARD_L-005.docx
NORSOK STANDARD_L-005.docxNORSOK STANDARD_L-005.docx
NORSOK STANDARD_L-005.docx
 
Shs (square hollow section) size range
Shs (square hollow section) size rangeShs (square hollow section) size range
Shs (square hollow section) size range
 
Elastomeros etileno acrilato_metila_vamac
Elastomeros etileno acrilato_metila_vamacElastomeros etileno acrilato_metila_vamac
Elastomeros etileno acrilato_metila_vamac
 
Fusca - "Manual vw-1300-1500"
Fusca - "Manual vw-1300-1500"Fusca - "Manual vw-1300-1500"
Fusca - "Manual vw-1300-1500"
 
Lista de dureza dos parafusos e porcas
Lista de dureza dos parafusos e porcasLista de dureza dos parafusos e porcas
Lista de dureza dos parafusos e porcas
 
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕES
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕESPARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕES
PARKER - MANUAL DE IDENFITICAÇÃO DE ROSCAS E SEDES DE VEDAÇÕES
 
Mengelas listrik dasar bu hettyk
Mengelas listrik dasar bu hettykMengelas listrik dasar bu hettyk
Mengelas listrik dasar bu hettyk
 
Teknik Pengelasan
Teknik Pengelasan Teknik Pengelasan
Teknik Pengelasan
 
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...
PLANEJAMENTO E CONTROLE DA PRODUÇÃO DO SISTEMA DE TUBULAÇÃO NAVAL DE UM REBOC...
 
Apostila arco submerso
Apostila arco submersoApostila arco submerso
Apostila arco submerso
 
Tabela roscas
Tabela roscasTabela roscas
Tabela roscas
 

Similaire à Working with Multiple Android Screens

Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011sullis
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Chris Griffith
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011sullis
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android TabletsOSCON Byrum
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15sullis
 
Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidXavier Hallade
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012Bruce Jones
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android ApplicationsCláudio André
 
Beginning Android Flash Development
Beginning Android Flash DevelopmentBeginning Android Flash Development
Beginning Android Flash DevelopmentStephen Chin
 
Creating Compelling Mobile User Experiences
Creating Compelling Mobile User ExperiencesCreating Compelling Mobile User Experiences
Creating Compelling Mobile User ExperiencesChris Griffith
 
Manual samsung galaxy tab 7.7
Manual samsung galaxy tab 7.7Manual samsung galaxy tab 7.7
Manual samsung galaxy tab 7.7Khaleeda Asa
 
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...goodfriday
 

Similaire à Working with Multiple Android Screens (20)

Ui patterns
Ui patternsUi patterns
Ui patterns
 
Beautifully Usable, Multiple Screens Too
Beautifully Usable, Multiple Screens TooBeautifully Usable, Multiple Screens Too
Beautifully Usable, Multiple Screens Too
 
Your First Adobe Flash Application for Android
Your First Adobe Flash Application for AndroidYour First Adobe Flash Application for Android
Your First Adobe Flash Application for Android
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15
 
Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on Android
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
 
Beginning Android Flash Development
Beginning Android Flash DevelopmentBeginning Android Flash Development
Beginning Android Flash Development
 
Creating Compelling Mobile User Experiences
Creating Compelling Mobile User ExperiencesCreating Compelling Mobile User Experiences
Creating Compelling Mobile User Experiences
 
Galaxy
Galaxy Galaxy
Galaxy
 
New widget
New widgetNew widget
New widget
 
campaing check outbound
campaing check outboundcampaing check outbound
campaing check outbound
 
Manual samsung galaxy tab 7.7
Manual samsung galaxy tab 7.7Manual samsung galaxy tab 7.7
Manual samsung galaxy tab 7.7
 
Android Presentation By Ashok Kumar Pachauri
Android Presentation By Ashok Kumar PachauriAndroid Presentation By Ashok Kumar Pachauri
Android Presentation By Ashok Kumar Pachauri
 
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
 

Plus de Motorola Mobility - MOTODEV

HTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureHTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureMotorola Mobility - MOTODEV
 
Getting Your App Discovered: Android Market & Beyond
Getting Your App Discovered: Android Market & BeyondGetting Your App Discovered: Android Market & Beyond
Getting Your App Discovered: Android Market & BeyondMotorola Mobility - MOTODEV
 
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript Motorola Mobility - MOTODEV
 
Consejos principales para Android UI Cómo alcanzar la magia en los tablets
Consejos principales para Android UI Cómo alcanzar la magia en los tabletsConsejos principales para Android UI Cómo alcanzar la magia en los tablets
Consejos principales para Android UI Cómo alcanzar la magia en los tabletsMotorola Mobility - MOTODEV
 
Cómo agregar calidad a sus aplicaciones mediante pruebas
Cómo agregar calidad a sus aplicaciones mediante pruebas Cómo agregar calidad a sus aplicaciones mediante pruebas
Cómo agregar calidad a sus aplicaciones mediante pruebas Motorola Mobility - MOTODEV
 
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuario
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuarioCómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuario
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuarioMotorola Mobility - MOTODEV
 
Gráficos cada vez mais rápidos utilização de NDK e Renderscript
Gráficos cada vez mais rápidos utilização de NDK e RenderscriptGráficos cada vez mais rápidos utilização de NDK e Renderscript
Gráficos cada vez mais rápidos utilização de NDK e RenderscriptMotorola Mobility - MOTODEV
 
Como integrar qualidade aos seus aplicativos através de testes
Como integrar qualidade aos seus aplicativos através de testesComo integrar qualidade aos seus aplicativos através de testes
Como integrar qualidade aos seus aplicativos através de testesMotorola Mobility - MOTODEV
 
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...Motorola Mobility - MOTODEV
 

Plus de Motorola Mobility - MOTODEV (20)

HTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureHTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the Future
 
The Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. WebThe Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. Web
 
Kill the Laptop!
Kill the Laptop!Kill the Laptop!
Kill the Laptop!
 
MOTODEV App Validator
MOTODEV App ValidatorMOTODEV App Validator
MOTODEV App Validator
 
Getting Your App Discovered: Android Market & Beyond
Getting Your App Discovered: Android Market & BeyondGetting Your App Discovered: Android Market & Beyond
Getting Your App Discovered: Android Market & Beyond
 
Introducing Fragments
Introducing FragmentsIntroducing Fragments
Introducing Fragments
 
Taking Advantage of Webtop
Taking Advantage of WebtopTaking Advantage of Webtop
Taking Advantage of Webtop
 
Building Quality Into Your Apps Through Testing
Building Quality Into Your Apps Through TestingBuilding Quality Into Your Apps Through Testing
Building Quality Into Your Apps Through Testing
 
Top Tips for Android UIs
Top Tips for Android UIsTop Tips for Android UIs
Top Tips for Android UIs
 
Designing Apps for Motorla Xoom Tablet
Designing Apps for Motorla Xoom TabletDesigning Apps for Motorla Xoom Tablet
Designing Apps for Motorla Xoom Tablet
 
Diseñando aplicaciones para el Motorola XOOM
Diseñando aplicaciones para el Motorola XOOM Diseñando aplicaciones para el Motorola XOOM
Diseñando aplicaciones para el Motorola XOOM
 
Presentación de los fragmentos
Presentación de los fragmentos Presentación de los fragmentos
Presentación de los fragmentos
 
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript
Gráficos cada vez más rápidos. Cómo usar NDK y RenderScript
 
Consejos principales para Android UI Cómo alcanzar la magia en los tablets
Consejos principales para Android UI Cómo alcanzar la magia en los tabletsConsejos principales para Android UI Cómo alcanzar la magia en los tablets
Consejos principales para Android UI Cómo alcanzar la magia en los tablets
 
Cómo agregar calidad a sus aplicaciones mediante pruebas
Cómo agregar calidad a sus aplicaciones mediante pruebas Cómo agregar calidad a sus aplicaciones mediante pruebas
Cómo agregar calidad a sus aplicaciones mediante pruebas
 
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuario
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuarioCómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuario
Cómo aprovechar Webtop Cómo HTML5 mejora la experiencia del usuario
 
Principais dicas para UIs do Android
Principais dicas para UIs do AndroidPrincipais dicas para UIs do Android
Principais dicas para UIs do Android
 
Gráficos cada vez mais rápidos utilização de NDK e Renderscript
Gráficos cada vez mais rápidos utilização de NDK e RenderscriptGráficos cada vez mais rápidos utilização de NDK e Renderscript
Gráficos cada vez mais rápidos utilização de NDK e Renderscript
 
Como integrar qualidade aos seus aplicativos através de testes
Como integrar qualidade aos seus aplicativos através de testesComo integrar qualidade aos seus aplicativos através de testes
Como integrar qualidade aos seus aplicativos através de testes
 
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...
Tirando vantagem do webtop como o html5 aprimora a experiência do usuário de ...
 

Dernier

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
[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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
[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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Working with Multiple Android Screens

  • 1. Working with Multiple Screens Make Your Android UI Rock Everywhere
  • 2. Suzanne Alexandra Android Developer Advocate, Motorola @suzalex http://moto.ly/samples © 2010 Motorola Mobility, Inc. All rights reserved except as otherwise explicitly indicated.
  • 3. Why does it matter?
  • 4. Make users happy Extend your reach
  • 5. Size really mattersPause & Watch DialingWandhttp://moto.ly/dialingwand
  • 6. Key Point #1Choose your target devices
  • 7. Android 1.5? QVGA? Global? As of November 2010, developer.android.com
  • 9. Comparing resolution DROID X480 x 854 Normal DROID PRO320 x 480 Normal FLIPOUT320 x 240 Small
  • 10. Comparing resolution DROID XHigh240 dpi DROID PROMedium160 dpi FLIPOUTLow120 dpi
  • 11.
  • 12. Key Point #2Start with a fewsimple guidelines.
  • 13. Pause the slides & watch the PhotoDemo video on YouTube
  • 14. Adjust your AndroidManifestfor versions and screen sizes.
  • 15. <uses-sdk android:minSdkVersion= "7" android:targetSdkVersion= "8" />
  • 16. <supports-screens android:largeScreens= "true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true" />
  • 17.
  • 18. Test thoroughly on your targetSdkVersion
  • 19.
  • 20.
  • 23. Low 1 dip = 0.75 pixels High 1 dip = 1.5 pixels Medium 1 dip = 1 pixel What’s a DIP? A pixel that changes size
  • 24. Pause the slides & Watch the RelativeLayout video on YouTube
  • 25. Use one set of images andlet Android scale them, for now. But we’ll look at this more later.
  • 26.
  • 27. Key Point #3 Add custom resources as needed, but watch performance.
  • 28. Add custom layouts, if you need them.But you might not.
  • 29.
  • 30.
  • 31. Custom resource sets for low, medium, and high density?
  • 32. Target the most commonly used density?
  • 33.
  • 34.
  • 35. 150% for high 100% for normal 75% for low
  • 36. Memory vs file size PhotoOne 32 MBmemory 324 KB size PhotoThree 23 MBmemory 728 KB size
  • 37. In other words Autoscaling uses memory.Custom image sets increase file size.
  • 38. What happens if you load a really big image into a small view?
  • 39. You might get No image Or a memory error
  • 40. Your application UI can behave differently across devicesor in different conditionsdue to memory
  • 41. Pause the slides & Watch the handling images video on YouTube
  • 42. private Bitmap loadBitmap() { DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); int screenDensity = metrics.densityDpi; BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = false; options.inSampleSize = 4; options.inScaled = true; options.inTargetDensity = screenDensity; Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.clover, options); return bitmap; }
  • 43. If you need to detect density at runtimeandroid.util.DisplayMetricsis cool
  • 44. Pause the slides &Watch the detecting device density video on YouTube
  • 45. 240 and 1.5 120 and 0.75 160 and 1.0
  • 46. public void checkDensity() { DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); String logical_density = Float.toString(metrics.density); Log.e (TAG, "Logical density is " + logical_density); // for API level 4 (Android 1.6) and forward String screen_density = Integer.toString(metrics.densityDpi); Log.e (TAG, "Screen density is " + screen_density); }
  • 47. Key Point #4 Touch and gesture are key. Make sure they’re density independent too.
  • 48. Pause the slides &Watch the buttons video on YouTube
  • 49. <ImageButton android:id="@+id/button" android:src="@drawable/button" android:clickable="true" android:layout_gravity="center_vertical|center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@null" android:padding="40dip" />
  • 50. 16 pixels 3.3 mm 1.7 mm 2.5 mm
  • 51. private static final float DISTANCE_DIP = 16.0f; private static final float PATH_DIP = 40.0f; // convert dip measurements to pixels final float scale = getResources().getDisplayMetrics().density; scaledDistance = (int) ( DISTANCE_DIP * scale + 0.5f ); scaledPath = (int) ( PATH_DIP * scale + 0.5f );
  • 52. Okay .. Remember the key points?
  • 53.
  • 54. Start with a few simple guidelines.
  • 55. Add custom resources as needed, but watch performance.
  • 56.
  • 57.
  • 58. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • 59. Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Other source code displayed in this presentation may be licensed under Apache License, Version 2
 Copyright © 2010, Android Open Source Project. All rights reserved unless otherwise explicitly indicated.
 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. DROID is a trademark of Lucasfilm Ltd. and its related companies. Used under license.