93
Intro to Google TV +Matt Gaunt

Intro to Google TV

Embed Size (px)

DESCRIPTION

An introduction to Google TV development, how you can bring your app's to the platform.

Citation preview

Page 1: Intro to Google TV

Intro to Google TV+Matt Gaunt

Page 2: Intro to Google TV

What?

Page 3: Intro to Google TV

The Open Smart TV Platform

Page 4: Intro to Google TV

Android

Page 5: Intro to Google TV

Big

7

Page 6: Intro to Google TV

Sony’s Internet streaming set-top box is available in the US, UK, Germany, Netherlands, France, Brazil, Canada, Mexico and Australia.

Page 7: Intro to Google TV

- ARM Processors

- More on the way...

Meet the Devices

LGSony Vizio

Page 8: Intro to Google TV

Why?

Page 9: Intro to Google TV

“”

In the US, homes have an average of 2.5 people and 2.93 TV sets

(and rising!)

Television Audience Report, 2009: The Nielsen Company

Page 10: Intro to Google TV

“”

In the US, people “watch” an average of ~5 hours of TV per day

Three Screen Report, Q1’10: The Nielsen Company

Page 11: Intro to Google TV

Continued Growth- 22% of US broadband household already own an HDTV with integrated

TV apps Source: In-Stat “Q2’11 US Digital Entertainment Database,” July 26, 2011

- 60% of connected-TV households will use a TV app at least once per week Source: In-Stat “Q2’11 US Digital Entertainment Database,” July 26, 2011

- By 2015, 500 million web enabled TV’sSource: Crave Asia, July 8, 2011

Page 12: Intro to Google TV

Interaction.

Page 13: Intro to Google TV

Cursor...

Page 14: Intro to Google TV

Cursor...

Page 15: Intro to Google TV

Cursor...

Page 16: Intro to Google TV

D-Pad

Page 17: Intro to Google TV

D-Pad

Page 18: Intro to Google TV
Page 19: Intro to Google TV

Mr. Leanback

RemoteControl

FavoriteBeverage

Page 20: Intro to Google TV

Focus

Page 21: Intro to Google TV
Page 22: Intro to Google TV
Page 23: Intro to Google TV
Page 24: Intro to Google TV
Page 25: Intro to Google TV

Beware the Trap!

Page 26: Intro to Google TV
Page 27: Intro to Google TV
Page 28: Intro to Google TV
Page 29: Intro to Google TV
Page 30: Intro to Google TV
Page 31: Intro to Google TV
Page 32: Intro to Google TV
Page 33: Intro to Google TV
Page 34: Intro to Google TV
Page 35: Intro to Google TV

2

1

3

Page 36: Intro to Google TV

Love it

Add Friend

Send

Show on Map

1 2 3

Page 37: Intro to Google TV

Love it

Add Friend

Send

Show on Map

Page 38: Intro to Google TV

Love it

Add Friend

Send

Show on Map

Page 39: Intro to Google TV

Love it

Add Friend

Send

Show on Map

Page 40: Intro to Google TV

LeftNavBar

Page 41: Intro to Google TV
Page 42: Intro to Google TV
Page 43: Intro to Google TV

XML

To Use It?

private LeftNavBar mLeftNavBar;

...

private LeftNavBar getLeftNavBar() { if (mLeftNavBar == null) {    mLeftNavBar = new LeftNavBar(this);    }    return mLeftNavBar;}

- Use the LeftNavBar like so...

- Then treat it like an ActionBar (it’s the same API)

Page 44: Intro to Google TV

Grab the Library Project Herehttp://code.google.com/p/googletv-android-samples/

Page 45: Intro to Google TV

So Much Space

Page 46: Intro to Google TV

29

• Traditionally designed consumption not interaction

• Far away = lower information density

• Ironically, not so good for reading a lot of text

• Big Sound: Great for video, and listening to music

• Different than phones: personal, location, size, touch

• Not just a big Tablet => more like a PHONE

Big, but small

Traditionally designed consumption not

Far away = lower information density

Ironically, not so good for reading a lot of

Big Sound: Great for video, and listening

Different than phones: personal, locatiot

Big, but small

Page 47: Intro to Google TV

Info

rmat

ion

on s

cree

n

Big

7

Page 48: Intro to Google TV
Page 49: Intro to Google TV
Page 50: Intro to Google TV

Think of Context

Page 51: Intro to Google TV

Social

Shared Experience

- Games, learning, exploring, music, shared experiences

- Privacy considerations

Page 52: Intro to Google TV
Page 53: Intro to Google TV

Second Screen Apps

Page 54: Intro to Google TV
Page 55: Intro to Google TV

Mr. Leanback

RemoteControl

Still Drinking His Favorite Beverage

Page 56: Intro to Google TV

“”

In the U.S., 88 percent of tablet owners and 86 percent of smartphone owners said they used

their device while watching TV...

Q4 2011 Survey of Connected Devices OwnersNielsen Company

Page 57: Intro to Google TV

39

Page 58: Intro to Google TV

39

RemoteControl

Smartphone

Laptop

Snack

Ms. Multi-screen

Tablet?

Page 59: Intro to Google TV

Anymote Protocol

Page 60: Intro to Google TV

Step 1: Discovery

mDNS Broadcasts

Hello? My IP address is xxx.xxx.x.x, I offer

service _anymote._tcp on port xxxx

Page 61: Intro to Google TV

Step 1: Discovery

Oh you have the _anymote._tcp service,

you must be a Google TV

Page 62: Intro to Google TV

Step 2: PairingHey, can I connect to you?

Pairing Request

Yeah sure :)Pairing Ack

Cool, well I can deal with hexadecimal passwords & ...

Well I can give you these challenges and you need to give me back this ...

Challenges it can deal with

Challenges it can give & expected response

Page 63: Intro to Google TV

Step 2: Pairing

Easy. “1234”

Secret

I challenge you!! MwuahahaChallenge

You got it, heres the top secret password “Awesome sauce”

Secret Ack

Page 64: Intro to Google TV

Step 3: Anymote

The fun part

Page 65: Intro to Google TV

But this wasn’t friendly :(

Page 66: Intro to Google TV

Anymote LibraryMakes Anymote easy to use

An Android Library project which simplifies finding, pairing and sending events to Google TV using the Anymote Protocol

1.Implement the AnymoteClientService.ClientListener interface (3 methods)

2.Implement a ServiceConnection to attach your ClientListener to the AnymoteClientService

3.Bind to the AnymoteClientService to initiate the pairing process

4.Use the AnymoteSender to send messages to Google TV using the Anymote protocol

Page 67: Intro to Google TV

Impl. ClientListener Interfacepublic class YourActivity extends Activity implements AnymoteClientService.ClientListener {

private AnymoteSender anymoteSender;

@Overridepublic void onConnected(AnymoteSender anymoteSender) {

this.anymoteSender = anymoteSender; // Save for sending messages}

@Overridepublic void onDisconnected() { ... }

@Overridepublic void onConnectionError() { ... }

...

}

Java

Page 68: Intro to Google TV

Impl. a ServiceConnectionprivate AnymoteClientService anymoteService;

private ServiceConnection serviceConnection = new ServiceConnection() {

public void onServiceConnected(ComponentName name, IBinder service) {anymoteService = ((AnymoteClientService.AnymoteClientServiceBinder) service).getService();anymoteService.attachClientListener(YourActivity.this); // YourActivity is a ClientListener

// TODO: Check if the service already has a AnymoteSender}

public void onServiceDisconnected(ComponentName name) {anymoteService.detachClientListener(YourActivity.this); // Stop receiving notificationsanymoteService = null;

}

};

Java

Page 69: Intro to Google TV

Bind to AnymoteClientService@Overridepublic void onCreate(Bundle savedInstanceState) {

...

Intent intent = new Intent(this, AnymoteClientService.class);bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);

}

Java

Page 70: Intro to Google TV

Want a Trackpad?Turn any View into a trackpad

Available Modes:

- POINTER- SCROLL_HORIZONTALLY- SCROLL_VERTICALLY-ZOOM_VERTICAL

new TouchHandler(someView, Mode.POINTER, anymoteSender);Java

Page 71: Intro to Google TV

Send Key EventsYou can send key events to take control of Google TV

For a full list of available key codes download the anymote-protocol and then look at ./proto/keycodes.proto

http://code.google.com/p/anymote-protocol/

someButton.setOnClickListener(new OnClickListener() {public void onClick(View v) {

anymoteSender.sendKeyPress(KeyEvent.KEYCODE_DPAD_CENTER);}

});

Java

Page 72: Intro to Google TV

Send Intents

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(“http://www.google.com”));anymoteSender.sendIntent(intent);

Java

Intent intent = new Intent(“com.example.yourapp.VIEW_ACTION”);anymoteSender.sendIntent(intent);

Java

Possibly the most powerful feature is the ability to send intents

Default use case is to open a companion application on the TV, but you can do more...

Page 73: Intro to Google TV

Control All the Apps...*

* with open intents

com.yourapp.ACTION_SHOW_FOO

com.randomapp.ACTION_SHOW_BAR

Page 74: Intro to Google TV

Samples + Anymote Libraryhttp://code.google.com/p/googletv-android-samples/

Page 75: Intro to Google TV

Noteworthy Bits- Limitations- One way communication- May not be the fastest (i.e. may not be suitable for games)

- Discovery handled by the app: Google TV Remote[1] (can use JmDNS)- Pairing & Auth: Pairing Protocol Reference Implementation[2]

- Sending Events: Anymote Protocol Reference Implementation[3]

- Pairing and Anymote Protocols user Protocol Buffers[4] (lite)- Google TV Remote for Android: http://code.google.com/p/google-tv-remote/- Pairing Protocol: http://code.google.com/p/google-tv-pairing-protocol/- Anymote Protocol: http://code.google.com/p/anymote-protocol/- Protocol Buffers: http://code.google.com/p/protobuf/

Page 76: Intro to Google TV

Leon Nicholls Anymote for Javahttps://github.com/entertailion/Anymote-for-Java

Page 77: Intro to Google TV

Tips & Good to Know

Page 78: Intro to Google TV

720p

1080p

large-tvdpi

large-xhdpi

Page 79: Intro to Google TV

Am I on TV yet?- Don’t forget the -television specifier

<?xml version="1.0" encoding="utf-8"?><resources> <bool name="is_television">false</bool></resources>

XML: values/bools.xml

<?xml version="1.0" encoding="utf-8"?><resources> <bool name="is_television">true</bool></resources>

XML: values-television/bools.xml

Page 80: Intro to Google TV

Say no to Toast

Page 81: Intro to Google TV

https://github.com/keyboardsurfer/Crouton

Page 82: Intro to Google TV
Page 83: Intro to Google TV
Page 84: Intro to Google TV

Please don’t do this

Page 85: Intro to Google TV

Publishing Time

Page 86: Intro to Google TV

Publishing No-No’s- Never do this

- This will get filtered out

- Use this and pain will follow

<activity android:screenOrientation="portrait"> XML

<uses-featureandroid:name="android.hardware.screen.portrait" android:required=”true” />

XML

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_POTRAIT); XML

Page 87: Intro to Google TV

Publishing Checklist- Tell Play that you don’t need touch events

- Do you need to target Google TV only?

- Lastly . . . Tell us about it

<uses-feature android:name="android.hardware.touchscreen"android:required= “false” />

XML

<uses-feature android:name="com.google.android.tv"android:required= “true” />

XML

Page 88: Intro to Google TV

More API’s

Page 89: Intro to Google TV

Future GTV API’s- Smooth Streaming support

- PlayReady support

- Custom Streaming & Custom DRM support

- Quality of Service (QoS) API’s

- Google I/O 2012 - Get Your Content Onto Google TV

- http://www.youtube.com/watch?feature=player_embedded&v=bNbKpUqkOso

Page 90: Intro to Google TV

YouTube Android Player API

Page 91: Intro to Google TV

http://developers.google.com/tv/

+Google TV Developers

Page 92: Intro to Google TV

Johan

Page 93: Intro to Google TV

<Thank You!>http://developers.google.com/tv/

[email protected]+matt gaunt@gauntface