owf12/paug conf days google tv part2 (commande and control) matt gaunt, advocate at google

34
Developers

Upload: open-world-forum

Post on 04-Jun-2015

723 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Developers

Page 2: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Command & Control... in the Living Room

Matthew GauntDeveloper Advocate

Page 3: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

3

Mr. Leanback

FavoriteBeverage

RemoteControl

Page 4: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

“ 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 Device OwnersNielsen Company

Page 5: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

5

RemoteControl

Smartphone

Laptop

Snack

Ms. Multi-screen

Tablet?

Page 6: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Google TV User Study

6

Average Number of Actively Used Connected Devices per Household with Google TV

Page 7: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Team More Typical

TabletLaptop

~3 Smartphones

Page 8: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

People want to do more than just watch TV

8

Page 9: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Able Remote

9

Turn your Android device into a customized Google TV remote

Page 10: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Peel Smart Remote AppExperience the magic of personalized TV with Peel Smart Remote

10

Page 11: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Trivialist (Locomo Labs)

11

Play live against everyone in your favorite sports bar!

Page 12: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

MOVL

12

Android and web-based multi-screen apps and APIs the work with Google TV!

Cloud Connect: Real-time connections over 3G and 4G

Direct Connect: Direct connection over WiFi between mobile device and Google TV

KontrolTV Platform/Controller: - Multi-screen- Multi-user- TV to TV collaboration- Auto-discovery- Android API for Google TV- JS API for Chrome

Page 13: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Anymote ProtocolI can haz second screen.

Page 14: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Anymote ProtocolThe Anymote Protocol is a specification that defines how second screen apps securely send input events to first screen devices on the same network.

Input events include:- Key events- Touch/mouse events- Android Intents

There is an Anymote Protocol Service on all Google TV devices that receives and responds to Anymote messages.

On Google TV, whichever app is in the foreground receives the Anymote events.

14

Page 15: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Communication with the Anymote Protocol

Client (2nd screen app) / Server (1st screen service) Communication Model

1. Discovery (mDNS)

2. Authentication and Pairing (Pairing Protocol)a. 2nd screen device sends pairing request to 1st screen device (Google TV)b. Google TV displays a challenge to the userc. Users enters challenge into 2nd screen deviced. 2nd screen device sends challenge to Google TVe. Google TV returns a TLS key for encrypting messages

3. Sending Events (Anymote)

15

Page 16: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Google TV Anymote Library

Page 17: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Anymote Library

Makes Anymote easy to use

An Android Library that simplifies finding, pairing with, 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 AnymoreClientService

3. Bind to the AnymoteClientService service to initiate the pairing process

4. User an AnymoteSnder to send messages to Google TV using the Anymore Protocol

17

Page 18: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Implement the ClientListener InterfaceReceive the AnymoteSender for sending messages to Google TV

18

public 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 19: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Implement a ServiceConnectionAttach your ClientListener to the AnymoteClientService

19

private 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

}

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

}

};

Java

Page 20: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Bind to the AnymoteClientServiceBegin the pairing process

20

@Overridepublic void onCreate(Bundle savedInstanceState) {

...

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

}

Java

Page 21: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Send Messages with the AnymoteSender

21

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

anymoteSender.sendKeyPress(KeyEvent.KEYCODE_DPAD_CENTER);}

});

Java

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

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

Page 22: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

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

(check out the samples!)

22

Page 23: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

The Anymote Protocol

• Protocol Specifications: https://developers.google.com/tv/remote/

• Discovery handled by app: Google TV Remote[1] (or use JmDNS)• Pairing and Authentication: Pairing Protocol Reference Implementation [2] (UI in app)• Sending Events: Anymote Protocol Reference Implementation [3]

• Pairing and Anymote Libraries use Protocol Buffers [4] (lite) for de/serializing data

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

23

Page 24: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

API’s to Come

Page 25: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Fundamentals of Streaming Content

• Custom Streaming support• Custom DRM support

• Google I/O 2012 - Get Your Content Onto Google TV• http://www.youtube.com/watch?feature=player_embedded&v=bNbKpUqkOso

25

Page 26: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

More Goodies

• QoS API’s - Allows you to detect frame rate, bandwidth, buffer size, buffer fill rate etc . . .

• Smooth Streaming support• PlayReady Support

26

Page 27: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Publishing Time

Page 28: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Play Store FTW

28

Page 29: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

We Filter Out Apps Where Appropriate

29

• This is a big old no

<activity android:screenOrientation="portrait"> XML

• This is will definitely get you filtered out of the results

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

XML

• Be careful how you use this, it’ll crash on GTV

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_POTRAIT); XML

Page 30: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Features Supported by GTV

• com.google.android.tv• android.hardware.location• android.hardware.location.network• android.hardware.usb.host• android.hardware.wifi• android.software.live_wallpaper• android.hardware.screen.landscape (API Level 13)

30

Page 31: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Publishing Checklist

• Tell Play that you don’t need touch events

31

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

XML

• Only targeting Google TV? No Problem

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

XML

• Lastly . . . . Tell us about it <------- :)

Page 32: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Oh and the Play Store just got Native

32

Page 33: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

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

[email protected]+matt gaunt@gauntface

Page 34: OWF12/PAUG Conf Days Google tv part2 (commande and control)     matt gaunt, advocate at google

Developers