Git Product home page Git Product logo

nativescript-android-tv's Introduction

NativeScript ❤️ Android TV

What?

Unsurprisingly Android TV is very much like the Android you know and love, and since NativeScript already runs like a champ on Android, you can easily support Android TV as well!

How?!

I found the easiest way to support TV devices is adding this line to your AndroidManifest.xml and figuring out at runtime which UI to load.

Wait.. does that mean I have to duplicate code?

You don't have to duplicate anything, but you really don't want to reuse phone layouts on your TV for obvious reasons. So what this PoC does, is using a main-page.xml for Phone / Tablet, and main-page-tv.xml for TV to accomodate for the additional screen real estate - but they share the same main-view-model.ts.

Can I use Angular or Vue as well?

Sure you can, as those eventually render the same UI widgets as regular NativeScript does.

And what about iOS?

Nothing special there - iOS is powered by the same code that makes the Android Phone / Tablet version tick.

Sorry, I meant Apple TV

Ah, OK, ehm, please refer to this blog.

Lemme try

Create an Android TV emulator with the AVD manager inside Android Studio (if you're not so lucky to own a real device), then:

git clone https://github.com/EddyVerbruggen/nativescript-android-tv
cd nativescript-android-tv
npm i
tns run android

nativescript-android-tv's People

Contributors

eddyverbruggen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.