Android Experiences · Linux • Java as a native language – safe bet: millions of developers –...

30
Android Experiences Tomi Mickelsson Senior Technology Specialist @ Idean http://overtheair.org/ April 4, 2008

Transcript of Android Experiences · Linux • Java as a native language – safe bet: millions of developers –...

Page 1: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

Android Experiences

Tomi MickelssonSenior Technology Specialist @ Idean

http://overtheair.org/April 4, 2008

Page 2: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

2 / 30

Agenda

Android Intro•

Framework•

SDK and tools•

UI, components, layouts•

UI goodies•

Custom UI•

Sample Prototypes–

Contacts & Splash

Good and Bad•

Wishlist

Page 3: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

3 / 30

Idean

User-centric mobile design–

User experience design–

User and market research–

Interaction design–

Visual design

Prototyping and development of user interfaces

Low-tech and high-tech

Strong focus on mobile•

Finland, Helsinki

Page 4: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

4 / 30

Why Prototype?

Get user feedback at an early stage•

Verify that the design meets the set requirements•

Get to know technology limitations•

Evaluate technologies•

Reduce risks, costs•

Great communication medium, beats docs

Page 5: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

5 / 30

Android

“Hot blonde that everybody wants to be with"•

Buzz: Linux, Java, Google, open-source•

First phones 2H2008?•

SDK open sourced eventually–

truly open-source: Apache-license

Backed by OHA, Open Handset Alliance–

mobile operators, device manufacturers, SW/HW companies

Page 6: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

6 / 30

Android Just Now

Pre-Alpha!•

Google is the architect–

Gathers feedback, improves–

Avoid design by committee

Not yet open•

Play with emulator and discover...•

Big changes between SDKs–

m3 vs m5 SDKs

Android Developer Challenge, ADC–

10 M$

Page 7: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

7 / 30

Android Architecture

Linux•

Java as a native language–

safe bet: millions of developers–

Java but not J2ME–

no JVM, a new Dalvik

Runtime

Currently no native access to OS•

OS is customizable–

replace system apps, even home screen

A whole new UI•

SQLite database

Page 8: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

8 / 30

Android Java Framework

Anatomy of an application:–

Activity–

Intent Receiver–

Service–

Content Provider

A new, innovative way to construct apps–

Learn it, don't fight against

Building screens and services, not monolithic black-boxes–

Loosely coupled, addressable parts–

Isn't this like the web? Back-button too!–

Rapid prototyping

OS or an ecosystem?

Page 9: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

9 / 30

SDK (m5-rc15)

Windows, OS X, Linux!•

124MB of HTML-docs•

183 Java sample source files•

New UI since m3–

from QVGA to HVGA

Decent and simple–

just unzip to a folder–

Docs, samples, binaries included

Page 10: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

10 / 30

SDK Tools

Emulator•

Eclipse–

ADT: Android Development Tools plugin–

DDMS: Dalvik Debug Monitor Server tool

Command line tools•

No user interface editor–

Edit, compile, test cycle takes 10s–

www.droiddraw.org

Page 11: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

11 / 30

Technologies for prototyping on Android

Java–

but not MIDP, there's a new UI

WebKit–

standalone browser–

embedded component–

but no access to the system?

OpenGL ES•

No C++•

No Flash /Lite

(yet)•

No Python (yet?)–

but Guido works at Google…–

used in SDK tools: activityCreator.py

Page 12: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

12 / 30

Application Design Philosophy

"Successful applications will offer an outstanding end-user experience"–

Fast–

Responsive–

Seamless

The industry takes user experience seriously!

Page 13: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

13 / 30

User Interface

Rich UI model, huge number of components•

Do not code, use XML–

Declarative programming ala web, Adobe Flex, Mozilla XUL

New APIs, no J2ME, AWT, Swing, LCDUI•

No other UIs: a single UI a good thing•

Both keypad and touch modes•

Layouts and components

Page 14: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

14 / 30

UI components, basic

Button, ImageButton, CheckBox, Chronometer, CompoundButton, EditText, ImageView, ProgressBar, SurfaceView, TextView, ZoomSlider, ExpandableListView, ListMenuItemView, ListView, RadioButton, RadioGroup, ScrollView, Spinner, Toast

Page 15: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

15 / 30

UI components, high-level

AutoCompleteTextView, AnalogClock, DigitalClock, MapView, DatePicker, Gallery, TabWidget, TextSwitcher, Ticker, TimePicker, TwoLineListItem, VideoView, WebView

Page 16: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

16 / 30

UI components, MapView

Location-based apps will be hot•

Android makes location-stuff easy–

Map-component built-in

Based on Google Maps

Page 17: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

17 / 30

UI components, WebView

Essential component–

So much is in web–

Mashup layouts

Industry standard WebKit–

Safari, S60 browser, Adobe AIR, QT...

Javascript, AJAX•

Embedded assets–

<img src="file:///android_asset/myimage.png">

Page 18: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

18 / 30

UI Layouts

Good set of layouts–

AbsoluteLayout, FrameLayout, Gallery, GridView, LinearLayout, ListView, RelativeLayout, ScrollView, Spinner, SurfaceView, TabHost, TableLayout, ViewFlipper, ViewSwitcher

You should understand layouts well–

”wrap_content”, ”fill_parent”, ”layout_weight”

Use relative layouts, fits into many screens•

Margins, paddings ala CSS

Page 19: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

19 / 30

Custom UI components

First try use existing–

Existing components already customizable

Framework very open for extra customization•

Strategies:–

Inherit and override a base component–

Reuse and combine existing components–

Fully draw yourself -

onDraw(Canvas canvas)‏

However, avoid overkill customization–

Variance among devices!–

Small screen vs big screen

Page 20: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

20 / 30

UI goodies

Touch (single, not multi)•

List fading at ends•

Scrollbar on off, fancy skins•

Context menu with touch•

Scrolling•

Rounded corners•

Themes•

Focus management•

Progressbar, primary, secondary, in title too

Page 21: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

21 / 30

UI goodies: Animation

Flash-alike stuff!•

Tweened animation: controlled by XML-files•

Frame-by-frame animation: controlled by code•

Shaders, shapes, gradients, pivot, path effects•

Drawing caches•

OpenGL too

Page 22: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

22 / 30

UI goodies: 9-Patch Stretchable

For custom look'n'feel•

Innovative, no code required•

Improves designer-developer-co-operation

Page 23: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

23 / 30

Sample Prototype: Contacts

Tabs•

Custom view with relativelayout•

WebKit browser component•

Text shadow

Page 24: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

24 / 30

Sample Prototype: Splash Anim

Flash-like animation–

Scale, rotate, alpha

PNG-graphics with alpha•

Dynamic layout–

View.GONE, View.VISIBLE

Page 25: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

25 / 30

Prototyping on Android -

Good

Java and Eclipse–

Familiar language, familiar tools

Rich UI model, customization features•

Declarative programming, XMLs•

Applications expose an ecosystem of components–

Reuse existing, mashup screens (activities)

SDK runs on all mainstream platforms•

Active support forum

Page 26: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

26 / 30

Prototyping on Android -

Bad

Just pre-alpha:–

SDK a moving target

Need to learn a big new UI API•

No interface editor yet•

No real phones, just an emulator•

Not yet open source

Page 27: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

27 / 30

Problems/Critique:

Bugs–

"This is a bug that will be fixed in an future SDK."–

"I just wasted 5 days for the challenge banging my head trying to figure out why..."

Deprecated or not?•

Missing functionality•

Animation bugs•

Nested layouts broken•

Samples with no code–

How to really program tabs?

Page 28: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

28 / 30

Detective Work

Playing Sherlock, digging SDK internals...

Page 29: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

29 / 30

Wishlist

Perfect the UI, make it coherent and simple–

Finetune API, drop odd classes–

Have a clear MVC•

UI editor•

Animation between activities•

Animation to change layouts –

Like Adobe Flex state transitions…•

Drag'n'drop•

Apply themes dynamically•

Intuitive touch, multi-touch•

Handle layout scaling, small to big screens•

Fix bugs

Page 30: Android Experiences · Linux • Java as a native language – safe bet: millions of developers – Java but not J2ME – no JVM, a new Dalvik Runtime • Currently no native access

30 / 30

The End

Thank You!