更新: uri を次のように変更します。
GTV のバージョン 3
content://com.google.tv.mediadevicesapp.ChannelListingProvider/channel_listing
また:
必要な権限を com.google.android.tv.permission.READ_CHANNELS から com.google.android.tv.mediadevices.permission.READ_STREAMS に変更します
返されるデータも少し異なります。
"channel_uri" を "url" に変更 "channel_name" を "name" に変更 "channel_number" を "channelNumber" に変更 "callsign" を "subName" に変更
v2 と v3 の両方をサポートするには
int version = 0;
try {
Class cl = Class.forName("com.google.android.tv.Version");
version = cl.getField("GTV_SDK_INT").getInt(null); }
catch (Exception ex) {}
String contentUri;
if (version == 0) {
// We're on old (Pre-V3 GoogleTV)
contentUri = "content://com.google.android.tv.provider/channel_listing";
} else {
// We're on V3 or newer.
contentUri = "content://com.google.tv.mediadevicesapp.ChannelListingProvider/channel_listing";
// or, if you're using the framework library:
// Uri contentUri = com.google.android.tv.provider.ChannelListingContract.Channels.CHANNEL_LISTING_URI
}
/*
Column names are:
callsign
channel_name
channel_number
channel_uri
data_source
*/