Intro to Google TV

Preview:

DESCRIPTION

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

Citation preview

Intro to Google TV+Matt Gaunt

What?

The Open Smart TV Platform

Android

Big

7

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

- ARM Processors

- More on the way...

Meet the Devices

LGSony Vizio

Why?

“”

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

“”

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

Three Screen Report, Q1’10: The Nielsen Company

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

Interaction.

Cursor...

Cursor...

Cursor...

D-Pad

D-Pad

Mr. Leanback

RemoteControl

FavoriteBeverage

Focus

Beware the Trap!

2

1

3

Love it

Add Friend

Send

Show on Map

1 2 3

Love it

Add Friend

Send

Show on Map

Love it

Add Friend

Send

Show on Map

Love it

Add Friend

Send

Show on Map

LeftNavBar

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)

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

So Much Space

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

Info

rmat

ion

on s

cree

n

Big

7

Think of Context

Social

Shared Experience

- Games, learning, exploring, music, shared experiences

- Privacy considerations

Second Screen Apps

Mr. Leanback

RemoteControl

Still Drinking His Favorite Beverage

“”

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

39

39

RemoteControl

Smartphone

Laptop

Snack

Ms. Multi-screen

Tablet?

Anymote Protocol

Step 1: Discovery

mDNS Broadcasts

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

service _anymote._tcp on port xxxx

Step 1: Discovery

Oh you have the _anymote._tcp service,

you must be a 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

Step 2: Pairing

Easy. “1234”

Secret

I challenge you!! MwuahahaChallenge

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

Secret Ack

Step 3: Anymote

The fun part

But this wasn’t friendly :(

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

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

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

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

...

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

}

Java

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

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

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...

Control All the Apps...*

* with open intents

com.yourapp.ACTION_SHOW_FOO

com.randomapp.ACTION_SHOW_BAR

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

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/

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

Tips & Good to Know

720p

1080p

large-tvdpi

large-xhdpi

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

Say no to Toast

https://github.com/keyboardsurfer/Crouton

Please don’t do this

Publishing Time

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

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

More API’s

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

YouTube Android Player API

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

+Google TV Developers

Johan

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

mattgaunt@google.com+matt gaunt@gauntface