Slide 1

Slide 1 text

Android-Fu There are prerequisites for this session available at http://lab.to/oscon2012 Please install the software if you want to follow the coding exercises. Please grab some paper and a pen from the front!

Slide 2

Slide 2 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning Ice Cream Sandwich and beyond

Slide 3

Slide 3 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning and beyond

Slide 4

Slide 4 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning Jelly Bean and beyond

Slide 5

Slide 5 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning Jelly Bean and beyond

Slide 6

Slide 6 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning Jelly Bean and beyond

Slide 7

Slide 7 text

Android-Fu Awesome apps for Paris Buttfield-Addison, Chris Neugebauer, Jon Manning Jelly Bean and beyond

Slide 8

Slide 8 text

Harnessing the power of turnips as the future of synergistic corporate infrastructure.

Slide 9

Slide 9 text

What You’ll Learn •Why mobile apps are different •Designing a mobile user experience •Android’s architecture •Building an Android app

Slide 10

Slide 10 text

Introduction (us, Android, etc etc etc)

Slide 11

Slide 11 text

Us.

Slide 12

Slide 12 text

Us.

Slide 13

Slide 13 text

Us.

Slide 14

Slide 14 text

Us.

Slide 15

Slide 15 text

We speak quickly. Please ask us to slow down if you want!

Slide 16

Slide 16 text

Android.

Slide 17

Slide 17 text

It’s an operating system

Slide 18

Slide 18 text

It’s an operating system for phones.

Slide 19

Slide 19 text

It’s an operating system for tablet devices.

Slide 20

Slide 20 text

The latest version 4.1 (“Jelly Bean”)

Slide 21

Slide 21 text

This tutorial: Designing Android Apps

Slide 22

Slide 22 text

This tutorial: Designing Android 4.0 Apps

Slide 23

Slide 23 text

The Goal: An Android App for OSCON

Slide 24

Slide 24 text

Housekeeping

Slide 25

Slide 25 text

Git! We’ve got a git repo full of our example app! git clone https://github.com/chrisjrn/oscon-2012-app.git cd oscon-2012-app git checkout talk_listing_start

Slide 26

Slide 26 text

Let’s talk about humans.

Slide 27

Slide 27 text

Humans are arrogant, lazy, and easily bored.

Slide 28

Slide 28 text

Humans are lazy. They don’t want to work to get nice things.

Slide 29

Slide 29 text

Humans are arrogant. They’ll expect other people to anticipate what they want, and give it to them the moment they want it.

Slide 30

Slide 30 text

Humans are easily bored. If something takes longer than a couple of seconds, they’re not interested.

Slide 31

Slide 31 text

Behold: your customer!

Slide 32

Slide 32 text

We’re kind of exaggerating.

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Mobile Design

Slide 36

Slide 36 text

Mobile computers are different to desktop computers.

Slide 37

Slide 37 text

Mobile apps are different to other apps.

Slide 38

Slide 38 text

Android is a Unix machine, but don’t write Unix programs.

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Small screens. Short attention spans. Limited capacity.

Slide 41

Slide 41 text

The Mouse Doesn’t Exist

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Direct Manipulation Rocks

Slide 44

Slide 44 text

Scrolling with inertia!

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

One of the things I was worried about was the lack of a gesture or shortcut for “page down one screenful of text”.

Slide 47

Slide 47 text

The iPhone’s inertia-like flick scrolling seems to work really well for this. - John Gruber, 2007

Slide 48

Slide 48 text

Direct manipulation rocks!

Slide 49

Slide 49 text

Direct manipulation sucks!

Slide 50

Slide 50 text

Direct manipulation sucks! (for you)

Slide 51

Slide 51 text

Crutch

Slide 52

Slide 52 text

Virtual keyboards suck

Slide 53

Slide 53 text

No tactile feedback.

Slide 54

Slide 54 text

Individual keys are small.

Slide 55

Slide 55 text

Keyboard entry = 50% of the screen is gone

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

Virtual keyboards rule

Slide 58

Slide 58 text

Keyboards hide when unnecessary.

Slide 59

Slide 59 text

Keyboards change when necessary.

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Typing still sucks.

Slide 62

Slide 62 text

The user’s hand is a solid object.

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Can tap these while looking at screen content Can’t tap these without covering the screen

Slide 66

Slide 66 text

Hands also hold the device.

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

The screen is small.

Slide 73

Slide 73 text

The human eye can only see so much.

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Make every pixel count.

Slide 77

Slide 77 text

Summary Direct Manipulation Keyboards Orientation

Slide 78

Slide 78 text

Android Principles And how it’s not iOS or GNOME or the Web

Slide 79

Slide 79 text

Android Principles

Slide 80

Slide 80 text

•Enchant me •Simplify my life •Make me amazing “Creative Vision” http://developer.android.com/design/get-started/creative-vision.html

Slide 81

Slide 81 text

We have no idea what these mean.

Slide 82

Slide 82 text

Our Creative Vision

Slide 83

Slide 83 text

Do one thing Do it well

Slide 84

Slide 84 text

“One thing” can mean “Some things” (but each should be obvious)

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

Make it easy to leave Make it even easier to return

Slide 91

Slide 91 text

“Our goal is to have people leave our website as quickly as possible.” http://www.google.com/about/company/philosophy/

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

Being a great app means Being great with other apps

Slide 94

Slide 94 text

Your app should provide features to other apps

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

If there’s a native experience, provide it.

Slide 98

Slide 98 text

If other apps provide functionality, use it

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

What does this mean? Double rainbow? So intense?

Slide 102

Slide 102 text

Android UI Paradigms

Slide 103

Slide 103 text

Actions

Slide 104

Slide 104 text

Do something Do it well

Slide 105

Slide 105 text

Do something Make it obvious

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

The Action Bar

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

What are actions?

Slide 111

Slide 111 text

FIT Scheme Frequent Important Typical http://developer.android.com/design/patterns/actionbar.html

Slide 112

Slide 112 text

Frequent

Slide 113

Slide 113 text

Important

Slide 114

Slide 114 text

Typical

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

What’s not in the action bar •Jump To Top •View my Profile •Mute •View Settings

Slide 121

Slide 121 text

Action Bar Paradigms

Slide 122

Slide 122 text

No content

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

Menus aren’t gone :(

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

Frequent Important Typical

Slide 127

Slide 127 text

Always Sometimes Never

Slide 128

Slide 128 text

Action Bars The most important things go here Split or single? Overflow Menu: Always, sometimes, or never?

Slide 129

Slide 129 text

Navigation

Slide 130

Slide 130 text

Where am I? What can I do here?

Slide 131

Slide 131 text

How did I get here? Where can I go next?

Slide 132

Slide 132 text

Navigation with the action bar

Slide 133

Slide 133 text

No content

Slide 134

Slide 134 text

Tabs

Slide 135

Slide 135 text

No content

Slide 136

Slide 136 text

No content

Slide 137

Slide 137 text

No content

Slide 138

Slide 138 text

No content

Slide 139

Slide 139 text

List navigation

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

No content

Slide 142

Slide 142 text

No content

Slide 143

Slide 143 text

No content

Slide 144

Slide 144 text

Lists A thing ALL of the things SOME of the things

Slide 145

Slide 145 text

Tabs SOME of the things SOME of the things SOME of the things

Slide 146

Slide 146 text

“Back” vs. “Up”

Slide 147

Slide 147 text

http://developer.android.com/design/patterns/navigation.html

Slide 148

Slide 148 text

http://developer.android.com/design/patterns/navigation.html

Slide 149

Slide 149 text

Graphic Design

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

Text

Slide 152

Slide 152 text

“layout and typography are crisp and meaningful.” http://developer.android.com/design/get-started/creative-vision.html

Slide 153

Slide 153 text

Swiss Design

Slide 154

Slide 154 text

No content

Slide 155

Slide 155 text

No content

Slide 156

Slide 156 text

No content

Slide 157

Slide 157 text

No content

Slide 158

Slide 158 text

Icons

Slide 159

Slide 159 text

No content

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

No content

Slide 162

Slide 162 text

No content

Slide 163

Slide 163 text

Icons should be obvious. If it’s not obvious, use text.

Slide 164

Slide 164 text

When is it obvious?

Slide 165

Slide 165 text

It’s obvious if lots of other apps do it

Slide 166

Slide 166 text

It’s obvious if it’s obvious

Slide 167

Slide 167 text

No content

Slide 168

Slide 168 text

No content

Slide 169

Slide 169 text

It’s obvious if Google has an icon for it http://developer.android.com/design/downloads/index.html

Slide 170

Slide 170 text

No content

Slide 171

Slide 171 text

No content

Slide 172

Slide 172 text

No content

Slide 173

Slide 173 text

No content

Slide 174

Slide 174 text

No content

Slide 175

Slide 175 text

No content

Slide 176

Slide 176 text

No content

Slide 177

Slide 177 text

No content

Slide 178

Slide 178 text

No content

Slide 179

Slide 179 text

An aside: Heuristic Analysis

Slide 180

Slide 180 text

No content

Slide 181

Slide 181 text

0 25 50 75 100 0 5 10 15 Percentage of Usability Problems Found Number of Evaluators

Slide 182

Slide 182 text

Analyse your results. Create findings.

Slide 183

Slide 183 text

Text Colours Icons In order of importance

Slide 184

Slide 184 text

Summary Think about design. Please.

Slide 185

Slide 185 text

Making an App

Slide 186

Slide 186 text

We’re going to make an OSCON app.

Slide 187

Slide 187 text

We’ll go through the process of conceptualising and designing the interface.

Slide 188

Slide 188 text

You’ll design some stuff!

Slide 189

Slide 189 text

You’ll work with the person next to you. Say hello!

Slide 190

Slide 190 text

Designing a Mobile App

Slide 191

Slide 191 text

Our Process

Slide 192

Slide 192 text

The tools you’ll need:

Slide 193

Slide 193 text

The tools you’ll need:

Slide 194

Slide 194 text

The tools you’ll need:

Slide 195

Slide 195 text

The tools you’ll need:

Slide 196

Slide 196 text

The tools you’ll need:

Slide 197

Slide 197 text

The tools you’ll need:

Slide 198

Slide 198 text

Start with an outline.

Slide 199

Slide 199 text

Start with an outline.

Slide 200

Slide 200 text

“I want to see what’s happening at OSCON.”

Slide 201

Slide 201 text

Outlines can be iterated upon.

Slide 202

Slide 202 text

Outlines can be iterated upon.

Slide 203

Slide 203 text

“I want to quickly see what’s happening at OSCON.”

Slide 204

Slide 204 text

No content

Slide 205

Slide 205 text

Now start listing features.

Slide 206

Slide 206 text

What are the three most important features that this app must have?

Slide 207

Slide 207 text

What We Thought See the details of a talk See what talks are on sometime Update the schedule

Slide 208

Slide 208 text

What We Thought See the details of a talk See what talks are on sometime Update the schedule

Slide 209

Slide 209 text

What We Thought Individual session screen See the details of a talk See what talks are on sometime Update the schedule

Slide 210

Slide 210 text

What We Thought Individual session screen List of sessions See the details of a talk See what talks are on sometime Update the schedule

Slide 211

Slide 211 text

What We Thought Individual session screen List of sessions List days of conference See the details of a talk See what talks are on sometime Update the schedule

Slide 212

Slide 212 text

What We Thought Individual session screen List of sessions List days of conference Updating should be invisible See the details of a talk See what talks are on sometime Update the schedule

Slide 213

Slide 213 text

Draw the screens needed for the features you’ve chosen.

Slide 214

Slide 214 text

OSCON 2012 Session How to grow a better turnip Turnips are a growing industry. Along with node.js they represent one of the biggest advances our field has ever seen. We should learn how to build a better turnip. This session teaches you everything you need to know. Bob Turnip Tuesday, 9AM to 12:30PM Portland 255 OSCON 2012 Days Monday Tuesday Wednesday Thursday Friday OSCON 2012 Timetable 9AM to 12:30PM 1:30PM to 5PM 5:30PM to 10PM Dancing Through Life How to Succeed in Business Why no one mourns the Wicked Brimstone and Treacle Someone Someone Someone Someone

Slide 215

Slide 215 text

Never code before designing.

Slide 216

Slide 216 text

Side note: API design is still design.

Slide 217

Slide 217 text

Code something and test it. Now.

Slide 218

Slide 218 text

No content

Slide 219

Slide 219 text

Iterate.

Slide 220

Slide 220 text

No content

Slide 221

Slide 221 text

Coffee time See you at 11:00am!

Slide 222

Slide 222 text

Step 1 A static app

Slide 223

Slide 223 text

Stage 1 Implement all of the screens of the app Will always show the same data, no matter what we press Will not be themed beyond the defaults

Slide 224

Slide 224 text

We’ll give you most of the code. Follow along with us.

Slide 225

Slide 225 text

Three screens to make.

Slide 226

Slide 226 text

What is an Android App?

Slide 227

Slide 227 text

A loose collection of managed Java classes Instructions telling Android how they all fit together An Android app is:

Slide 228

Slide 228 text

The Manifest An XML file that describes the contents of the app to the Android OS More on that later.

Slide 229

Slide 229 text

Activities public void onCreate(Bundle foo) { doLol(); } public void warble() { } UI bits

Slide 230

Slide 230 text

No content

Slide 231

Slide 231 text

Rare Startup Shutdown Frequent Rare

Slide 232

Slide 232 text

UI thread vs. background threads Great and epic battle?

Slide 233

Slide 233 text

http://developer.android.com/guide/practices/design/responsiveness.html

Slide 234

Slide 234 text

“The developer of this app was lazy and foolish, please check the Play Store for something better!” http://developer.android.com/guide/practices/design/responsiveness.html

Slide 235

Slide 235 text

Keeping off the UI thread

Slide 236

Slide 236 text

Views

Slide 237

Slide 237 text

No content

Slide 238

Slide 238 text

Image View

Slide 239

Slide 239 text

Image View Text View

Slide 240

Slide 240 text

Image View Text View Button

Slide 241

Slide 241 text

Image View Text View Scroll Pane Button

Slide 242

Slide 242 text

Image View Text View Scroll Pane Button Composite Layout

Slide 243

Slide 243 text

Fragments

Slide 244

Slide 244 text

Your New Master

Slide 245

Slide 245 text

Introduced in 3.0, Back-ported to 1.6. It’s that important.

Slide 246

Slide 246 text

Views with code Views with a life cycle

Slide 247

Slide 247 text

No content

Slide 248

Slide 248 text

No content

Slide 249

Slide 249 text

Activities vs. Fragments

Slide 250

Slide 250 text

Activities are expensive

Slide 251

Slide 251 text

No content

Slide 252

Slide 252 text

FRAGMENTS

Slide 253

Slide 253 text

Fragments Many at once.

Slide 254

Slide 254 text

Talk Listings

Slide 255

Slide 255 text

(We’re going to code now!) git checkout talk_listing_start

Slide 256

Slide 256 text

git checkout talk_listing_end

Slide 257

Slide 257 text

Adding a second screen

Slide 258

Slide 258 text

We need one activity to launch another.

Slide 259

Slide 259 text

Intents

Slide 260

Slide 260 text

Intents

Slide 261

Slide 261 text

OS-Level signals Used to launch activities

Slide 262

Slide 262 text

OS-Level signals Used to launch other apps

Slide 263

Slide 263 text

Schedule

Slide 264

Slide 264 text

(We’re going to code now!) git checkout schedule_start

Slide 265

Slide 265 text

git checkout schedule_end

Slide 266

Slide 266 text

Days List

Slide 267

Slide 267 text

(We’re going to code now) git checkout day_list_start

Slide 268

Slide 268 text

git checkout day_list_end

Slide 269

Slide 269 text

Finished (for now)!

Slide 270

Slide 270 text

Finishing An App Part 2

Slide 271

Slide 271 text

YOU ARE HERE.

Slide 272

Slide 272 text

Implementing “Up” navigation

Slide 273

Slide 273 text

(Coding goes here) (git checkout navigation_start)

Slide 274

Slide 274 text

git checkout navigation_end

Slide 275

Slide 275 text

Backing it with data

Slide 276

Slide 276 text

(Coding Exercise) (git checkout data_start)

Slide 277

Slide 277 text

git checkout data_end

Slide 278

Slide 278 text

Adding tab navigation

Slide 279

Slide 279 text

(Coding exercise) git checkout tabs_start

Slide 280

Slide 280 text

git checkout tabs_end

Slide 281

Slide 281 text

Themeing the app

Slide 282

Slide 282 text

Coding Exercise (git checkout theme_start)

Slide 283

Slide 283 text

git checkout theme_end

Slide 284

Slide 284 text

The End?

Slide 285

Slide 285 text

Problems!

Slide 286

Slide 286 text

“It’s too slow!”

Slide 287

Slide 287 text

No content

Slide 288

Slide 288 text

No content

Slide 289

Slide 289 text

No content

Slide 290

Slide 290 text

No content

Slide 291

Slide 291 text

No content

Slide 292

Slide 292 text

No content

Slide 293

Slide 293 text

a-ha!

Slide 294

Slide 294 text

git checkout make_faster

Slide 295

Slide 295 text

“I don’t know what’s on now.”

Slide 296

Slide 296 text

From This

Slide 297

Slide 297 text

To This...

Slide 298

Slide 298 text

...Or This

Slide 299

Slide 299 text

git checkout navigation_refresh

Slide 300

Slide 300 text

“I want session reminders.” “I want to tweet sessions.” “I want abstracts from the website.”

Slide 301

Slide 301 text

git checkout talk_listing_update

Slide 302

Slide 302 text

Polish.

Slide 303

Slide 303 text

git checkout themeing_finished

Slide 304

Slide 304 text

Finished! http://lab.to/oscon2012apk

Slide 305

Slide 305 text

Bringing it together (We have a point to make)

Slide 306

Slide 306 text

Building apps people want to use Harder than you think.

Slide 307

Slide 307 text

People do not like phones. Because they’re generally unpleasant to use.

Slide 308

Slide 308 text

Mobile users hate being surprised.

Slide 309

Slide 309 text

Dialog boxes suck.

Slide 310

Slide 310 text

Dialog boxes suck.

Slide 311

Slide 311 text

Dialog boxes suck. Being modal also sucks.

Slide 312

Slide 312 text

Dialog boxes suck. Being modal also sucks.

Slide 313

Slide 313 text

A similar problem: deleting stuff

Slide 314

Slide 314 text

What should happen?

Slide 315

Slide 315 text

Option 1: Do nothing

Slide 316

Slide 316 text

Option 2: Pop a dialog box!

Slide 317

Slide 317 text

Option 3: Quietly indicate.

Slide 318

Slide 318 text

No content

Slide 319

Slide 319 text

No content

Slide 320

Slide 320 text

Be fast. We mentioned this before. http://lab.to/qQlVJW

Slide 321

Slide 321 text

Pretend to be fast. (If you’re not fast!)

Slide 322

Slide 322 text

Be responsive.

Slide 323

Slide 323 text

Lag equals death.

Slide 324

Slide 324 text

No content

Slide 325

Slide 325 text

No content

Slide 326

Slide 326 text

Most apps start uploading here

Slide 327

Slide 327 text

Instagram starts uploading here Most apps start uploading here

Slide 328

Slide 328 text

No content

Slide 329

Slide 329 text

Never drop data.

Slide 330

Slide 330 text

Expose yourself.

Slide 331

Slide 331 text

The device’s conditions change. A lot.

Slide 332

Slide 332 text

No content

Slide 333

Slide 333 text

Things that can change: Screen size Speed of CPU / GPU Available memory Storage space Network speed Everything ✔ ✔ ✔ ✔ ✔ ✔

Slide 334

Slide 334 text

No content

Slide 335

Slide 335 text

Minimise your views Views are expensive!

Slide 336

Slide 336 text

Minimise your views Views are expensive! MEMORY PROBLEM

Slide 337

Slide 337 text

Think about first launch

Slide 338

Slide 338 text

Think about first launch

Slide 339

Slide 339 text

Your home activity Straightforward, aesthetic, consistent.

Slide 340

Slide 340 text

Think about the ecosystem It’s more than just your app.

Slide 341

Slide 341 text

It starts in the Marketplace.

Slide 342

Slide 342 text

*Slide stolen from Roman Nurik’s Google Developer Day 2010 presentation.

Slide 343

Slide 343 text

*Slide stolen from Roman Nurik’s Google Developer Day 2010 presentation.

Slide 344

Slide 344 text

No content

Slide 345

Slide 345 text

Where am I?

Slide 346

Slide 346 text

Where am I? What can I do?

Slide 347

Slide 347 text

Where am I? What can I do? What else can I do?

Slide 348

Slide 348 text

Constant collaboration between design and development

Slide 349

Slide 349 text

Style your app. Never port it.

Slide 350

Slide 350 text

No content

Slide 351

Slide 351 text

Beware the Port

Slide 352

Slide 352 text

Some iOS apps ported to Android and look bad.

Slide 353

Slide 353 text

No content

Slide 354

Slide 354 text

No content

Slide 355

Slide 355 text

No content

Slide 356

Slide 356 text

Start development early.

Slide 357

Slide 357 text

Mobile is the perfect storm

Slide 358

Slide 358 text

Greatest Strength? It runs on a whole bunch of devices.

Slide 359

Slide 359 text

Biggest Weakness? It runs on a whole bunch of devices.

Slide 360

Slide 360 text

Thanks for coming!

Slide 361

Slide 361 text

Important Things! •Give us feedback • http://spkr8.com/t/13641 • http://lab.to/oscon2012 •Office Hours: Android Development & Mobile UX • 10:40am Wednesday, near the O’Reilly Expo Booth. •Download the App! • http://lab.to/oscon2012apk

Slide 362

Slide 362 text

@thesecretlab