pulse news: porting android app to tablet

47
ALL SIZES FIT ONE A Thrilling Adventure in Application Design for Tablets Monday, September 12, 2011

Upload: paris-android-user-group

Post on 22-Jan-2015

940 views

Category:

Technology


2 download

DESCRIPTION

http://paug.fr

TRANSCRIPT

Page 1: Pulse News: porting android app to tablet

ALL SIZES FIT ONEA Thrilling Adventure in Application Design for

Tablets

Monday, September 12, 2011

Page 2: Pulse News: porting android app to tablet

ALBERT LAI@albertlaiJEAN HSU@jyhsu

ANDROID AT PULSE

Monday, September 12, 2011

Page 3: Pulse News: porting android app to tablet

SHAMELESS PLUG!

Monday, September 12, 2011

Page 4: Pulse News: porting android app to tablet

PART Ie Human Component

Monday, September 12, 2011

Page 5: Pulse News: porting android app to tablet

WHEN DEVELOPERS SAY SOMETHING IS IMPOSSIBLE... THEY’RE LYING

Monday, September 12, 2011

Page 6: Pulse News: porting android app to tablet

TABLETS ARE A COMPLETELY NEW EXPERIENCE. DESIGN APPROPRIATELY.

Monday, September 12, 2011

Page 7: Pulse News: porting android app to tablet

NEVER TRUST THE SYSTEM TO DO A HUMAN’S JOB

Monday, September 12, 2011

Page 8: Pulse News: porting android app to tablet

DIALOGS CAN KEEP YOUR APP FROM LOOKING SILLY

Monday, September 12, 2011

Page 9: Pulse News: porting android app to tablet

stretchySILLY

Monday, September 12, 2011

Page 10: Pulse News: porting android app to tablet

dialogBETTER!

Monday, September 12, 2011

Page 11: Pulse News: porting android app to tablet

USERS ROTATE TABLETS. THIS IS A FACT OF LIFE.

Monday, September 12, 2011

Page 12: Pulse News: porting android app to tablet

THINK OF HANDHELD AND TABLET-STAND STYLE USAGES

Monday, September 12, 2011

Page 13: Pulse News: porting android app to tablet

THUMB FRIENDLY NAVIGATIONMonday, September 12, 2011

Page 14: Pulse News: porting android app to tablet

PART IINow for the Technical Stuff

Monday, September 12, 2011

Page 15: Pulse News: porting android app to tablet

RELATIVE LAYOUTS ARE AN ANDROID DEVELOPER’S BEST FRIEND

Monday, September 12, 2011

Page 16: Pulse News: porting android app to tablet

ALIGN PARENT RIGHTCENTER VERTICAL

ALIGN PARENT BOTTOMCENTER HORIZONTAL

ALIGN PARENT TOPALIGN PARENT LEFT

Monday, September 12, 2011

Page 17: Pulse News: porting android app to tablet

ALIGN PARENT RIGHTCENTER VERTICAL

ALIGN PARENT BOTTOMCENTER HORIZONTAL

ALIGN PARENT TOPALIGN PARENT LEFT

Monday, September 12, 2011

Page 18: Pulse News: porting android app to tablet

DEFINING A TABLET IS LIKE NAILING JELLO TO A WALL

??????

Monday, September 12, 2011

Page 19: Pulse News: porting android app to tablet

IS THIS A REALLY BIG PHONE?

Monday, September 12, 2011

Page 20: Pulse News: porting android app to tablet

OR A REALLY SMALL TABLET?

Monday, September 12, 2011

Page 21: Pulse News: porting android app to tablet

IT’S DANGEROUS TO GO ALONE. TAKE THESE RESOURCE FOLDERS

large, xlarge mdpi, hdpi, xhdpi

Monday, September 12, 2011

Page 22: Pulse News: porting android app to tablet

<style name="ConditionalDialog" parent="@android:style/Theme.Black">

<item name="android:windowNoTitle">true</item> </style>

values/theme.xml

Monday, September 12, 2011

Page 23: Pulse News: porting android app to tablet

<style name="ConditionalDialog" parent="@android:style/Theme.Dialog">

<item name="android:windowNoTitle">true</item> </style>

values-xlarge/theme.xml

Monday, September 12, 2011

Page 24: Pulse News: porting android app to tablet

HOW DO YOU KNOW WHAT SIZE DEVICE YOU’RE ON IN CODE?

Monday, September 12, 2011

Page 25: Pulse News: porting android app to tablet

IN YOUR LAYOUT XML FILE:

<include layout="@layout/screen_size" />

Monday, September 12, 2011

Page 26: Pulse News: porting android app to tablet

<?xml version="1.0" encoding="utf-8"?><View xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen_size_normal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone"/>

layout/theme.xml

Monday, September 12, 2011

Page 27: Pulse News: porting android app to tablet

<?xml version="1.0" encoding="utf-8"?><View xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen_size_large" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone"/>

layout-large/theme.xml

Monday, September 12, 2011

Page 28: Pulse News: porting android app to tablet

THERE ARE NO MAGIC NUMBERS.

Monday, September 12, 2011

Page 29: Pulse News: porting android app to tablet

THERE ARE NO MAGIC NUMBERS.

DIMENS.XMLINTEGERS.XML

Monday, September 12, 2011

Page 30: Pulse News: porting android app to tablet

NEVER SCALE UP ASSETS. USERS CAN TELL FROM THE PIXELS.

Monday, September 12, 2011

Page 31: Pulse News: porting android app to tablet

USE A HELPER CLASS FOR THE TRICKIER DIMENSIONS

Monday, September 12, 2011

Page 32: Pulse News: porting android app to tablet

screen_width / 3

Monday, September 12, 2011

Page 33: Pulse News: porting android app to tablet

PART IIIHoneycombs

Monday, September 12, 2011

Page 34: Pulse News: porting android app to tablet

I CAN HAZ FEATURES?

Monday, September 12, 2011

Page 35: Pulse News: porting android app to tablet

I CAN HAZ FEATURES?

mEditor.apply();

since API Level 9Monday, September 12, 2011

Page 36: Pulse News: porting android app to tablet

REFLECTION

Method m = SharedPreferences.Editor.class.getMethod("apply");

// ...

if (m != null) {m.invoke(mEditor);

} else { mEditor.commit(); }

Monday, September 12, 2011

Page 37: Pulse News: porting android app to tablet

WRAPPER

classes not loaded (and verified) until it is called the first time

only load the wrapper class if new functionality exists

Monday, September 12, 2011

Page 38: Pulse News: porting android app to tablet

PART IVOptimizing for the

Honeycombs

Monday, September 12, 2011

Page 39: Pulse News: porting android app to tablet

ONE-LINERS FTW

android:hardwareAccelerated="true"

android:targetSdkVersion="11"

Monday, September 12, 2011

Page 40: Pulse News: porting android app to tablet

MENU PLEASE..

pulse before

??Monday, September 12, 2011

Page 41: Pulse News: porting android app to tablet

BYOACTION BARS

TextOVERFLOW

NO MENU

LEFT-ALIGNED LOGO ACTIONS

Monday, September 12, 2011

Page 42: Pulse News: porting android app to tablet

FRAGMENTS (NOT THE BAD KIND)

Monday, September 12, 2011

Page 43: Pulse News: porting android app to tablet

PART IVAPKs

Monday, September 12, 2011

Page 44: Pulse News: porting android app to tablet

MULTIPLE APK SUPPORT

PHONE APK

TABLET APK

Monday, September 12, 2011

Page 45: Pulse News: porting android app to tablet

ONE APK TO RULE THEM ALL

SUPER AWESOME

APK

Monday, September 12, 2011

Page 46: Pulse News: porting android app to tablet

TEST LIKE YOUR LIFE DEPENDS ON IT

before each releaseand all the timewherever you canon every deviceand every api level

Monday, September 12, 2011

Page 47: Pulse News: porting android app to tablet

BUT DON’T TAKE OUR WORD FOR IT EXPLORE AND CREATE!

Monday, September 12, 2011