SlideShare una empresa de Scribd logo
1 de 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]

Más contenido relacionado

La actualidad más candente

데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)
데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)
데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)Minwoo Kim
 
Odoo acces rights & groups
Odoo acces rights & groupsOdoo acces rights & groups
Odoo acces rights & groupsLithin Thampan
 
코드 생성을 사용해 개발 속도 높이기 NDC2011
코드 생성을 사용해 개발 속도 높이기 NDC2011코드 생성을 사용해 개발 속도 높이기 NDC2011
코드 생성을 사용해 개발 속도 높이기 NDC2011Esun Kim
 
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介![CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!エピック・ゲームズ・ジャパン Epic Games Japan
 
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대CONNECT FOUNDATION
 
時間制限付きクイズアプリをつくる
時間制限付きクイズアプリをつくる時間制限付きクイズアプリをつくる
時間制限付きクイズアプリをつくるFumiya Sakai
 
01.개발환경 교육교재
01.개발환경 교육교재01.개발환경 교육교재
01.개발환경 교육교재Hankyo
 
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?Yongho Ha
 
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化UnityTechnologiesJapan002
 
어서 와! 번역은 처음이지?
어서 와! 번역은 처음이지?어서 와! 번역은 처음이지?
어서 와! 번역은 처음이지?복연 이
 
이벤트 로그 설계 구축기.pdf
이벤트 로그 설계 구축기.pdf이벤트 로그 설계 구축기.pdf
이벤트 로그 설계 구축기.pdfssuser0f6f15
 
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기Jaeseung Ha
 
[24]안드로이드 웹뷰의 모든것
[24]안드로이드 웹뷰의 모든것[24]안드로이드 웹뷰의 모든것
[24]안드로이드 웹뷰의 모든것NAVER Engineering
 
DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學River Wang
 
AbemaTVの動画配信を支えるサーバーサイドシステム
AbemaTVの動画配信を支えるサーバーサイドシステムAbemaTVの動画配信を支えるサーバーサイドシステム
AbemaTVの動画配信を支えるサーバーサイドシステムyuichiro nakazawa
 
Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기YEONG-CHEON YOU
 

La actualidad más candente (20)

데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)
데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)
데이터 분석에 필요한 기본 개념: 지표, Funnel 등 데이터를 이해하기 위한 멘탈 모델(Mental Model)
 
Odoo acces rights & groups
Odoo acces rights & groupsOdoo acces rights & groups
Odoo acces rights & groups
 
코드 생성을 사용해 개발 속도 높이기 NDC2011
코드 생성을 사용해 개발 속도 높이기 NDC2011코드 생성을 사용해 개발 속도 높이기 NDC2011
코드 생성을 사용해 개발 속도 높이기 NDC2011
 
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介![CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
 
UniRx の1歩目
UniRx の1歩目UniRx の1歩目
UniRx の1歩目
 
猫でもわかる Epic MegaGrants 応募への道
猫でもわかる Epic MegaGrants 応募への道猫でもわかる Epic MegaGrants 応募への道
猫でもわかる Epic MegaGrants 応募への道
 
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대
[부스트캠퍼세미나]권혁우_REST는 바이바이_ GraphQL과 함께하는 칼퇴시대
 
時間制限付きクイズアプリをつくる
時間制限付きクイズアプリをつくる時間制限付きクイズアプリをつくる
時間制限付きクイズアプリをつくる
 
01.개발환경 교육교재
01.개발환경 교육교재01.개발환경 교육교재
01.개발환경 교육교재
 
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?어떻게 하면 데이터 사이언티스트가 될 수 있나요?
어떻게 하면 데이터 사이언티스트가 될 수 있나요?
 
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
 
어서 와! 번역은 처음이지?
어서 와! 번역은 처음이지?어서 와! 번역은 처음이지?
어서 와! 번역은 처음이지?
 
이벤트 로그 설계 구축기.pdf
이벤트 로그 설계 구축기.pdf이벤트 로그 설계 구축기.pdf
이벤트 로그 설계 구축기.pdf
 
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기
NDC2018 안드로이드+유니티 네이티브 프로파일링 삽질기
 
猫でも分かる Control Rig UE4.25 版
猫でも分かる Control Rig UE4.25 版猫でも分かる Control Rig UE4.25 版
猫でも分かる Control Rig UE4.25 版
 
[24]안드로이드 웹뷰의 모든것
[24]안드로이드 웹뷰의 모든것[24]안드로이드 웹뷰의 모든것
[24]안드로이드 웹뷰의 모든것
 
UE4 MultiPlayer Online Deep Dive 基礎編2 -Traveling- (historia様ご講演) #ue4dd
UE4 MultiPlayer Online Deep Dive 基礎編2 -Traveling-  (historia様ご講演)  #ue4ddUE4 MultiPlayer Online Deep Dive 基礎編2 -Traveling-  (historia様ご講演)  #ue4dd
UE4 MultiPlayer Online Deep Dive 基礎編2 -Traveling- (historia様ご講演) #ue4dd
 
DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學
 
AbemaTVの動画配信を支えるサーバーサイドシステム
AbemaTVの動画配信を支えるサーバーサイドシステムAbemaTVの動画配信を支えるサーバーサイドシステム
AbemaTVの動画配信を支えるサーバーサイドシステム
 
Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기
 

Similar a 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
 

Similar a 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...
 

Más 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
 

Más 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 ...
 

Último

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
[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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 

Último (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
[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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 

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.