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

Weitere ähnliche Inhalte

Was ist angesagt?

Legal ethics & cloud computing
Legal ethics & cloud computingLegal ethics & cloud computing
Legal ethics & cloud computingPatrick Fowler
 
Bab 8 pendeteksian tepi
Bab 8 pendeteksian tepiBab 8 pendeteksian tepi
Bab 8 pendeteksian tepiSyafrizal
 
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptx
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptxbilgi-guvenligi-farkindalik-egitimi------2pptx.pptx
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptxssuser1205cb
 
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...Roko Subagya
 
Routing Dynamic Protocol (RIP)
Routing Dynamic Protocol (RIP)Routing Dynamic Protocol (RIP)
Routing Dynamic Protocol (RIP)Lusiana Diyan
 
Template PPT Semhas septi.pptx
Template PPT Semhas septi.pptxTemplate PPT Semhas septi.pptx
Template PPT Semhas septi.pptxSeptianaseptiana4
 
Langkah overhoul generator
Langkah overhoul generatorLangkah overhoul generator
Langkah overhoul generatorDra Hendra
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with FridaSatria Ady Pradana
 
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)Kriptografi - Algoritma Kriptografi Klasik (bagian 2)
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)KuliahKita
 

Was ist angesagt? (15)

Test ketelitian
Test ketelitianTest ketelitian
Test ketelitian
 
Legal ethics & cloud computing
Legal ethics & cloud computingLegal ethics & cloud computing
Legal ethics & cloud computing
 
Bab 8 pendeteksian tepi
Bab 8 pendeteksian tepiBab 8 pendeteksian tepi
Bab 8 pendeteksian tepi
 
B-Card Symposium Vygon CFRC Forum de l'Urgence
B-Card Symposium Vygon CFRC Forum de l'UrgenceB-Card Symposium Vygon CFRC Forum de l'Urgence
B-Card Symposium Vygon CFRC Forum de l'Urgence
 
Cpld top dos tops
Cpld top dos topsCpld top dos tops
Cpld top dos tops
 
Pert-5_DD-CD-DFD.ppt
Pert-5_DD-CD-DFD.pptPert-5_DD-CD-DFD.ppt
Pert-5_DD-CD-DFD.ppt
 
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptx
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptxbilgi-guvenligi-farkindalik-egitimi------2pptx.pptx
bilgi-guvenligi-farkindalik-egitimi------2pptx.pptx
 
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...
8500+ ALAMAT EMAIL:::: Daftar Alamat Surat Elektronik Gmail, YAHOOMAIL,HOTMAI...
 
Routing Dynamic Protocol (RIP)
Routing Dynamic Protocol (RIP)Routing Dynamic Protocol (RIP)
Routing Dynamic Protocol (RIP)
 
Part 1 - PENGANTAR KRIPTOGRAFI
Part 1 - PENGANTAR KRIPTOGRAFIPart 1 - PENGANTAR KRIPTOGRAFI
Part 1 - PENGANTAR KRIPTOGRAFI
 
Template PPT Semhas septi.pptx
Template PPT Semhas septi.pptxTemplate PPT Semhas septi.pptx
Template PPT Semhas septi.pptx
 
Kode Etik Pengguna IT
Kode Etik Pengguna ITKode Etik Pengguna IT
Kode Etik Pengguna IT
 
Langkah overhoul generator
Langkah overhoul generatorLangkah overhoul generator
Langkah overhoul generator
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)Kriptografi - Algoritma Kriptografi Klasik (bagian 2)
Kriptografi - Algoritma Kriptografi Klasik (bagian 2)
 

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

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

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

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

Kürzlich hochgeladen

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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 

Kürzlich hochgeladen (20)

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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 

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.