94
Android Sean Sullivan June 22, 2011

Android - Open Source Bridge 2011

  • Upload
    sullis

  • View
    2.158

  • Download
    1

Embed Size (px)

DESCRIPTION

Android Open Source Bridge Portland, Oregon June 22, 2011

Citation preview

Page 1: Android - Open Source Bridge 2011

Android

Sean SullivanJune 22, 2011

Page 2: Android - Open Source Bridge 2011

• Introduction

• OSB Android app

• Android tablets

• Android 3.x

Page 3: Android - Open Source Bridge 2011
Page 4: Android - Open Source Bridge 2011
Page 5: Android - Open Source Bridge 2011

iPhone Android

Page 6: Android - Open Source Bridge 2011
Page 7: Android - Open Source Bridge 2011
Page 8: Android - Open Source Bridge 2011
Page 9: Android - Open Source Bridge 2011
Page 10: Android - Open Source Bridge 2011
Page 11: Android - Open Source Bridge 2011
Page 12: Android - Open Source Bridge 2011
Page 13: Android - Open Source Bridge 2011
Page 14: Android - Open Source Bridge 2011
Page 15: Android - Open Source Bridge 2011

Android tablets

Page 16: Android - Open Source Bridge 2011
Page 17: Android - Open Source Bridge 2011
Page 18: Android - Open Source Bridge 2011
Page 19: Android - Open Source Bridge 2011
Page 20: Android - Open Source Bridge 2011
Page 21: Android - Open Source Bridge 2011
Page 22: Android - Open Source Bridge 2011
Page 23: Android - Open Source Bridge 2011
Page 24: Android - Open Source Bridge 2011
Page 25: Android - Open Source Bridge 2011
Page 26: Android - Open Source Bridge 2011
Page 27: Android - Open Source Bridge 2011
Page 28: Android - Open Source Bridge 2011
Page 29: Android - Open Source Bridge 2011

What’s new in Android 3.x?

Page 30: Android - Open Source Bridge 2011
Page 31: Android - Open Source Bridge 2011

• ‘holographic’ UI theme

• Action Bar

• Fragments

• Drag and Drop

• Digital Rights Management

• and more...

Page 32: Android - Open Source Bridge 2011

‘holographic’ UI

Page 33: Android - Open Source Bridge 2011
Page 34: Android - Open Source Bridge 2011

Action Bar

Page 35: Android - Open Source Bridge 2011

“The Action Bar is a widget for activities that replaces the traditional title bar at the top of the screen.

By default, the Action Bar includes the application logo on the left side, followed by the activity title, and any available items from the Options Menu on the right side.”

Page 36: Android - Open Source Bridge 2011

Action Bar

Page 37: Android - Open Source Bridge 2011
Page 38: Android - Open Source Bridge 2011

Fragments

Page 39: Android - Open Source Bridge 2011

“A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running.”

http://developer.android.com/guide/topics/fundamentals/fragments.html

Page 40: Android - Open Source Bridge 2011

• Fragments decompose application functionality and UI into reusable modules

• Add multiple fragments to a screen to avoid switching activities

• Fragments have their own lifecycle, state, and back stack

• Fragments require API Level "Honeycomb" or greater

http://developer.android.com/guide/topics/fundamentals/fragments.html

Page 41: Android - Open Source Bridge 2011

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"        android:orientation="horizontal"        android:layout_width="match_parent"        android:layout_height="match_parent">

    <fragment class="com.example.android.apis.app.TitlesFragment"            android:id="@+id/titles" android:layout_weight="1"            android:layout_width="0px"            android:layout_height="match_parent" />

    <FrameLayout android:id="@+id/details" android:layout_weight="1"            android:layout_width="0px"            android:layout_height="match_parent" />    </LinearLayout>

Page 42: Android - Open Source Bridge 2011

public static class TitlesFragment extends ListFragment {    private boolean mDualPane;    private int mCurCheckPosition = 0;

    @Override    public void onActivityCreated(Bundle savedState) {        super.onActivityCreated(savedState); // do something here    }

    @Override    public void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);        outState.putInt("curChoice", mCurCheckPosition);    }

    @Override    public void onListItemClick(ListView l, View v, int pos, long id) {        // do something here    }

}

Page 43: Android - Open Source Bridge 2011
Page 44: Android - Open Source Bridge 2011
Page 45: Android - Open Source Bridge 2011

Drag and drop

Page 46: Android - Open Source Bridge 2011
Page 47: Android - Open Source Bridge 2011
Page 48: Android - Open Source Bridge 2011

Renderscript

Page 49: Android - Open Source Bridge 2011

“The Renderscript rendering and computational APIs offer a low-level, high performance means of carrying out mathematical calculations and 3D graphics rendering.”

Page 50: Android - Open Source Bridge 2011
Page 51: Android - Open Source Bridge 2011

New animation API

Page 52: Android - Open Source Bridge 2011
Page 53: Android - Open Source Bridge 2011

New JSON API

Page 54: Android - Open Source Bridge 2011
Page 55: Android - Open Source Bridge 2011

Digital Rights Management API

Page 56: Android - Open Source Bridge 2011
Page 57: Android - Open Source Bridge 2011

The same security issues that have led to piracy concerns on the Android platform have made it difficult for us to secure a common Digital Rights Management (DRM) system on these devices. [...] Although we don’t have a common platform security mechanism and DRM, we are able to work with individual handset manufacturers to add content protection to their devices.

November 2010http://blog.netflix.com/2010/11/netflix-on-android.html

Page 58: Android - Open Source Bridge 2011

Unfortunately, this is a much slower approach and leads to a fragmented experience on Android, in which some handsets will have access to Netflix and others won’t.

We will also continue to work with the Android community, handset manufacturers, carriers, and other service providers to develop a standard, platform-wide solution that allows content providers to deliver their services to all Android-based devices

November 2010http://blog.netflix.com/2010/11/netflix-on-android.html

Page 59: Android - Open Source Bridge 2011
Page 60: Android - Open Source Bridge 2011

New in Android 3.1

• Open Accessory API

• USB Host API

• Input from mice, joysticks, gamepads

• Resizable home screen widgets

• Media Transfer Protocol (MTP)

• Real-time Transport Protocol (RTP)

Page 61: Android - Open Source Bridge 2011

Application development

Page 62: Android - Open Source Bridge 2011
Page 63: Android - Open Source Bridge 2011
Page 64: Android - Open Source Bridge 2011

Android emulator

Page 65: Android - Open Source Bridge 2011
Page 66: Android - Open Source Bridge 2011

Emulator performance

Page 67: Android - Open Source Bridge 2011
Page 68: Android - Open Source Bridge 2011

Because the Android emulator must simulate the ARM instruction set on your computer and the WXGA screen is significantly larger than a typical virtual device, emulator performance is much slower than a real device.

source: developer.android.com

Page 69: Android - Open Source Bridge 2011

In particular, initializing the emulator can be slow and can take several minutes, depending on your hardware. When the emulator is booting, there is limited user feedback, so please be patient and wait until you see the home screen (or lock screen) appear.

source: developer.android.com

Page 70: Android - Open Source Bridge 2011

However, you don't need to boot the emulator each time you rebuild your application—typically you only need to boot at the start of a session and keep it running. Also see the tip below for information about using a snapshot to drastically reduce startup time after the first initialization.We're working hard to resolve the performance issues and it will improve in future tools releases.

source: developer.android.com

Page 71: Android - Open Source Bridge 2011
Page 72: Android - Open Source Bridge 2011
Page 73: Android - Open Source Bridge 2011
Page 74: Android - Open Source Bridge 2011
Page 75: Android - Open Source Bridge 2011
Page 76: Android - Open Source Bridge 2011
Page 77: Android - Open Source Bridge 2011
Page 78: Android - Open Source Bridge 2011
Page 79: Android - Open Source Bridge 2011
Page 80: Android - Open Source Bridge 2011
Page 81: Android - Open Source Bridge 2011

Sample code

Page 82: Android - Open Source Bridge 2011
Page 83: Android - Open Source Bridge 2011
Page 84: Android - Open Source Bridge 2011

API differences

Page 85: Android - Open Source Bridge 2011
Page 86: Android - Open Source Bridge 2011

http://developer.android.com/sdk/api_diff/11/changes.html

Page 87: Android - Open Source Bridge 2011

Best practices

Page 88: Android - Open Source Bridge 2011

http://android-developers.blogspot.com/2011/02/best-practices-for-honeycomb-and.html

Page 89: Android - Open Source Bridge 2011
Page 90: Android - Open Source Bridge 2011

What’s next?

Page 91: Android - Open Source Bridge 2011
Page 92: Android - Open Source Bridge 2011
Page 93: Android - Open Source Bridge 2011

Final thoughts

• Android 3.1 is for tablets, not phones

• XOOM, Galaxy Tab, G-Slate are available now

• More tablets coming to market

• Learn the Fragments API

Page 94: Android - Open Source Bridge 2011

Thank you