Search code examples
androidandroid-5.0-lollipopandroid-tv

how to do Implementation of Android TvView


I have started working on Android Smart Tv. I have to make a TvView, I Know Leanback is only library which gives us a lot of stuff to work with Android Smart Tv. Last day i have tried to work with TvView to perform streaming of channels. I have included android-support-Leanback17 . but still i am getting error That no class definition found. Any Help will be appreciated . i Just want to know that which library support this TvView. Thanks in Advance

This is my LogCat

  11-27 09:25:10.684: E/AndroidRuntime(16203): FATAL EXCEPTION: main
  11-27 09:25:10.684: E/AndroidRuntime(16203): java.lang.NoClassDefFoundError:    android.media.tv.TvView
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at    com.example.tvtest.MainActivity.onCreate(MainActivity.java:25)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.Activity.performCreate(Activity.java:5104)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.os.Handler.dispatchMessage(Handler.java:99)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.os.Looper.loop(Looper.java:137)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at android.app.ActivityThread.main(ActivityThread.java:5041)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at java.lang.reflect.Method.invokeNative(Native Method)
   11-27 09:25:10.684: E/AndroidRuntime(16203):     at java.lang.reflect.Method.invoke(Method.java:511)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:596)
  11-27 09:25:10.684: E/AndroidRuntime(16203):  at dalvik.system.NativeStart.main(Native Method)

Solution

  • I'm assuming you want to allow users to watch content and if so, you will not actually implement a TVView. Google provides the 'Live Channels' app which will display channels provided via the TVInputFramework. This app is hidden until an app implementing the TVInputFramework is installed.

    Google has now released a sample app implementing the TVInputFramework which will publish channels that can be watched in the Live Channels app.

    Documentation outlining the TVInputFramework: http://developer.android.com/training/tv/tif/index.html

    I hope this will at least point you in the right direction even if it doesn't directly answer your question.