Question

I'm looking for a way to launch the live tv app of a google tv by intent without giving any channel uri.

I tried this:

Uri uri = Uri.parse("tv://");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

This code launch Live Tv app on a black screen and I can't change channels.

I tried fake uri too, but this trick only returns me this toast : "Could not tune to the requested stream"

When I launch the Live Tv app manually, in a conventional way, I can see the channels and navigate through them by pressing the CH+ and CH- buttons.

I can't use uri because the channel listing is empty.

Était-ce utile?

La solution

I found the anwser ! Follow this link for more informations : Anymote to invoke keyevents on Google TV itsself

You can launch the live tv without channel uri by intent :

final Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("tv://passthrough"));
startActivity(intent);

Autres conseils

You are going to have to tap into the Channel Listing api and manage the channel details yourself. Have a look at the Channel Listing APIs - https://developers.google.com/tv/android/docs/gtv_provider

Once you know the channel number from your own channel data source, you should send the individual digits to the TV over Anymote (with a delay between each digit) to simulate a user typing in that channel number. This works consistently with various Google TV devices and in various countries.

Do not try and manipulate the TV Uri to make the TV change to a channel. The TV Uri format is not standardized and is different for different Google TV device manufacturers. Here are just a few examples:

tv://channel/VODDM?deviceId=irb_0&channelNumber=250
tv://channel?deviceId=irb_0&channelNumber=250
tv://channel/EHD?deviceId=Time%20Warner%20Cable
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top