Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android TV development

Android TV development

Talk from Riga Dev Day 2015

David Vávra

January 27, 2015
Tweet

More Decks by David Vávra

Other Decks in Programming

Transcript

  1. Introduction to Android TV
    development
    David Vávra, Avast Mobile

    View Slide

  2. Computer-
    phone-like UI
    Remote control
    with 60+ buttons
    Fragmented
    developer
    ecosystem

    View Slide

  3. Leanback
    content-focused
    UI
    Game controller
    or a phone
    Unified developer
    ecosystem

    View Slide

  4. Demo time

    View Slide

  5. Hardware
    Nexus Player available in Google Play in US and Canada. Price: $99
    Intel Atom 1.8Ghz Quad-core with graphics, 1 GB RAM, 8 GB flash
    All 2015 4K and smart TV models.
    All 2015 Philips TV models.
    All 2015 UB and UH series models.
    Razer Forge TV - gaming console, Snapdragon quad-core 2.5Ghz +
    Ardeno GPU, available in Q1 2015 for $99, 4 controllers, “lapboard”

    View Slide

  6. Design

    View Slide

  7. Creative vision
    Casual
    Consumption
    Cinematic
    Experience
    Simplicity

    View Slide

  8. Navigation

    View Slide

  9. Content organization
    compile “com.android.support:leanback-v17:21.0.+”
    Android Studio → New Project → TV → Android
    TV Activity

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. Overscan

    android:id="@+id/base_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_marginTop="27dp"
    android:layout_marginLeft="48dp"
    android:layout_marginRight="48dp"
    android:layout_marginBottom="27dp" >

    View Slide

  15. Development

    View Slide

  16. Basics
    Full Android
    Lollipop
    Emulator
    Hardware-limited
    (GPS, telephony,...)

    android:required="false" />
    android:required="false" />
    android:banner="@drawable/banner"
    android:theme="@style/Theme.Leanback">
    android:name=".activity.MainActivity">







    View Slide

  17. Recommendations
    Android notifications (category, local, ongoing)
    Periodically launch service to generate
    Don’t forget to remove them

    View Slide

  18. Search
    ContentProvider with defined columns
    ○ TEXT, CONTENT_TYPE, PRODUCTION_YEAR required
    searchable.xml defining the search & Intents

    View Slide

  19. Controllers
    4 directions, SELECT,
    BACK, HOME
    @Override
    public boolean dispatchGenericMotionEvent(MotionEvent ev)
    @Override
    public boolean dispatchKeyEvent(KeyEvent event)
    Multiple controllers
    android:configChanges="keyboard|keyboardHidden|navigation"

    View Slide

  20. Games
    Landscape, shared
    Overscan
    android:isGame="true"
    Play Game Services

    View Slide

  21. How did I do MoodSync?
    github.com/destil/MoodSync
    Media Projection API
    Palette
    LIFX SDK

    View Slide

  22. Avast Mobile is hiring
    [email protected]

    View Slide

  23. Q & A
    +David Vávra
    @destil
    https://developer.android.com/design/tv
    https://developer.android.com/training/tv

    View Slide