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

Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53
Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53
Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53mvourtsian
 
αμυντικοί μηχανισμοί του ανθρώπινου σώματος
αμυντικοί μηχανισμοί του ανθρώπινου σώματος  αμυντικοί μηχανισμοί του ανθρώπινου σώματος
αμυντικοί μηχανισμοί του ανθρώπινου σώματος Άρτεμη Μπάρκα
 
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣ
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣ
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣstefmar8
 
ενότητα 11 (παιχνιδια)
ενότητα 11 (παιχνιδια)ενότητα 11 (παιχνιδια)
ενότητα 11 (παιχνιδια)Giorgos Baroutas
 
Μπέρτολτ Μπρεχτ
Μπέρτολτ  ΜπρεχτΜπέρτολτ  Μπρεχτ
Μπέρτολτ ΜπρεχτEvangelia Patera
 
Ανθρώπινα δικαιώματα
Ανθρώπινα δικαιώματαΑνθρώπινα δικαιώματα
Ανθρώπινα δικαιώματαchavalesnick
 
Θανατική ποινή
Θανατική ποινήΘανατική ποινή
Θανατική ποινήchavalesnick
 
Συνάρτηση "1-1"
Συνάρτηση "1-1"Συνάρτηση "1-1"
Συνάρτηση "1-1"peri2005
 
ΑΝΘΡΩΠΙΝΑ ΔΙΚΑΙΩΜΑΤΑ
ΑΝΘΡΩΠΙΝΑ  ΔΙΚΑΙΩΜΑΤΑΑΝΘΡΩΠΙΝΑ  ΔΙΚΑΙΩΜΑΤΑ
ΑΝΘΡΩΠΙΝΑ ΔΙΚΑΙΩΜΑΤΑPELAMAKI
 
Το ιδανικό σχολείο
Το ιδανικό σχολείοΤο ιδανικό σχολείο
Το ιδανικό σχολείοgeormak
 
παράγραφος τρόποι ανάπτυξης
παράγραφος τρόποι ανάπτυξηςπαράγραφος τρόποι ανάπτυξης
παράγραφος τρόποι ανάπτυξηςorfeas70
 
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣAlexandra Gerakini
 
Η πειθώ στη διαφημιση
Η πειθώ στη διαφημιση   Η πειθώ στη διαφημιση
Η πειθώ στη διαφημιση Ελενη Λιουσα
 
6. ραψωδία ζ 139-259, ραψωδία ι 240-512
6. ραψωδία ζ 139-259, ραψωδία ι 240-5126. ραψωδία ζ 139-259, ραψωδία ι 240-512
6. ραψωδία ζ 139-259, ραψωδία ι 240-512JoannaArtinou
 
κλιση του λυω
κλιση του λυωκλιση του λυω
κλιση του λυωssuser5a7e1c
 
Διαφήμιση
ΔιαφήμισηΔιαφήμιση
Διαφήμισηsokaniak
 
αρχαια ελληνικη ενδυμασια
αρχαια ελληνικη ενδυμασιααρχαια ελληνικη ενδυμασια
αρχαια ελληνικη ενδυμασιαvenetokleiakia
 
Λατινικά, ενότητα 31
Λατινικά, ενότητα 31Λατινικά, ενότητα 31
Λατινικά, ενότητα 31gina zaza
 

Tendances (20)

Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53
Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53
Φύλλο εργασίας δομημένης μορφής στην Ιλιάδα ,ραψ.Α 1-53
 
αμυντικοί μηχανισμοί του ανθρώπινου σώματος
αμυντικοί μηχανισμοί του ανθρώπινου σώματος  αμυντικοί μηχανισμοί του ανθρώπινου σώματος
αμυντικοί μηχανισμοί του ανθρώπινου σώματος
 
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣ
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣ
ΔΕΥΤΕΡΕΥΟΥΣΕΣ ΠΡΟΤΑΣΕΙΣ
 
ενότητα 11 (παιχνιδια)
ενότητα 11 (παιχνιδια)ενότητα 11 (παιχνιδια)
ενότητα 11 (παιχνιδια)
 
γαλλική επανάσταση
γαλλική επανάστασηγαλλική επανάσταση
γαλλική επανάσταση
 
Μπέρτολτ Μπρεχτ
Μπέρτολτ  ΜπρεχτΜπέρτολτ  Μπρεχτ
Μπέρτολτ Μπρεχτ
 
Ανθρώπινα δικαιώματα
Ανθρώπινα δικαιώματαΑνθρώπινα δικαιώματα
Ανθρώπινα δικαιώματα
 
Θανατική ποινή
Θανατική ποινήΘανατική ποινή
Θανατική ποινή
 
Συνάρτηση "1-1"
Συνάρτηση "1-1"Συνάρτηση "1-1"
Συνάρτηση "1-1"
 
ΑΝΘΡΩΠΙΝΑ ΔΙΚΑΙΩΜΑΤΑ
ΑΝΘΡΩΠΙΝΑ  ΔΙΚΑΙΩΜΑΤΑΑΝΘΡΩΠΙΝΑ  ΔΙΚΑΙΩΜΑΤΑ
ΑΝΘΡΩΠΙΝΑ ΔΙΚΑΙΩΜΑΤΑ
 
Το ιδανικό σχολείο
Το ιδανικό σχολείοΤο ιδανικό σχολείο
Το ιδανικό σχολείο
 
παράγραφος τρόποι ανάπτυξης
παράγραφος τρόποι ανάπτυξηςπαράγραφος τρόποι ανάπτυξης
παράγραφος τρόποι ανάπτυξης
 
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ
ΟΣΟ ΜΠΟΡΕΙΣ, Κ.ΚΑΒΑΦΗΣ, ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ
 
Η πειθώ στη διαφημιση
Η πειθώ στη διαφημιση   Η πειθώ στη διαφημιση
Η πειθώ στη διαφημιση
 
6. ραψωδία ζ 139-259, ραψωδία ι 240-512
6. ραψωδία ζ 139-259, ραψωδία ι 240-5126. ραψωδία ζ 139-259, ραψωδία ι 240-512
6. ραψωδία ζ 139-259, ραψωδία ι 240-512
 
κλιση του λυω
κλιση του λυωκλιση του λυω
κλιση του λυω
 
Διαφήμιση
ΔιαφήμισηΔιαφήμιση
Διαφήμιση
 
αρχαια ελληνικη ενδυμασια
αρχαια ελληνικη ενδυμασιααρχαια ελληνικη ενδυμασια
αρχαια ελληνικη ενδυμασια
 
Λατινικά, ενότητα 31
Λατινικά, ενότητα 31Λατινικά, ενότητα 31
Λατινικά, ενότητα 31
 
Νινέτ της Ζωρζ Σαρρή
Νινέτ  της Ζωρζ ΣαρρήΝινέτ  της Ζωρζ Σαρρή
Νινέτ της Ζωρζ Σαρρή
 

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

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
 
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
 
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
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
[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
 
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
 
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
 
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
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

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
 
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
 
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
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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?
 
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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
[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
 
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
 
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
 
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
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

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.