Slide 1

Slide 1 text

Developing for the Big Screen From Android TV to Chromecast

Slide 2

Slide 2 text

about me Hasan Hosgel G+: Hasan Hosgel Twitter: @alosdev Github: alosdev Senior Developer @ImmobilienScout24

Slide 3

Slide 3 text

Prerequisite ● casual consumption - not focused like on phone ● cinematic experience - 3 meter away ● Simplicity - no touchpad

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Navigation ● D-Pad in two axis ● enter Button ● Back ● Home

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Navigation support ● use appropriate states for better recognotion of focus/ selection ● use sound - occasionally ● use next focus targets - for defining own navigation flow ⇒ TEST IT properly

Slide 8

Slide 8 text

how to get started ● Sample Project https://github.com/googlesamples/androidtv- Leanback/ ● DevByte Video https://www.youtube.com/watch? v=72K1VhjoL98

Slide 9

Slide 9 text

needed libraries ● v17 leanback support library ● v7 recyclerview support library ● v7 cardview support library forces to use also ● v4 support library

Slide 10

Slide 10 text

AndroidManifest extension

Slide 11

Slide 11 text

AndroidManifest extension

Slide 12

Slide 12 text

AndroidManifest extension

Slide 13

Slide 13 text

Not supported Hardware features ● android.hardware.touchscreen ● android.hardware.telephony ● android.hardware.camera ● android.hardware.nfc ● android.hardware.location.gps ● android.hardware.microphone

Slide 14

Slide 14 text

avoid filtering in play store ● set the attribute “required” to “false” in AndroidManifest ⇒ If you don’t to this, the application cannot be found on the play store for TV

Slide 15

Slide 15 text

recognize TV programmatically UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE); if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) { Log.d(TAG, "Running on a TV Device") } else { Log.d(TAG, "Running on a non-TV Device") }

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

BrowseFragment

Slide 18

Slide 18 text

BrowseFragment

Slide 19

Slide 19 text

DetailFragment

Slide 20

Slide 20 text

VerticalGridFragment

Slide 21

Slide 21 text

SearchFragment

Slide 22

Slide 22 text

How to test? ● ADT-1 ● Nexus Player ● Emulator

Slide 23

Slide 23 text

ChromeCast ● Sender Application ○ Android ○ Chrome ○ IOs ● Receiver Application ○ HTML ⇒ register your receiver application https://cast. google.com/publish/ - costs 5$

Slide 24

Slide 24 text

needed libraries ● v7 appcompat support library ● v7 mediarouter support library ● google play services library forces to use also ● v4 support library

Slide 25

Slide 25 text

Resources ● Site: https://developers.google.com/cast/ ● repositories: https://developers.google. com/cast/docs/downloads

Slide 26

Slide 26 text

Additional possibility for Android With the feature “mirror screen” you can now use the “presentation mode” again for your Android application, like for MiraCast

Slide 27

Slide 27 text

Q & A