UnsurprisinglyAndroidTVisverymuchliketheAndroidyouknowandlove,andsinceNativeScriptalreadyrunslikeachamponAndroid,youcaneasilysupportAndroidTVaswell!
How?!IfoundtheeasiestwaytosupportTVdevicesisaddingthislinetoyourAndroidManifest.xmlandfiguringoutatruntimewhichUItoload.
Wait..doesthatmeanIhavetoduplicatecode?Youdon'thavetoduplicateanything,butyoureallydon'twanttoreusephonelayoutsonyourTVforobviousreasons.SowhatthisPoCdoes,isusingamain-page.xmlforPhone/Tablet,andmain-page-tv.xmlforTVtoaccomodatefortheadditionalscreenrealestate-buttheysharethesamemain-view-model.ts.
CanIuseAngularorVueaswell?Sureyoucan,asthoseeventuallyrenderthesameUIwidgetsasregularNativeScriptdoes.
AndwhataboutiOS?Nothingspecialthere-iOSispoweredbythesamecodethatmakestheAndroidPhone/Tabletversiontick.
Sorry,ImeantAppleTVAh,OK,ehm,pleaserefertothisblog.
LemmetryCreateanAndroidTVemulatorwiththeAVDmanagerinsideAndroidStudio(ifyou'renotsoluckytoownarealdevice),then:
gitclonehttps://github.com/EddyVerbruggen/nativescript-android-tvcdnativescript-android-tvnpmitnsrunandroid
评论