Solved Is there any documentation available for Kodi Channels on the Android TV Launcher?
#1
I found this single post on how to create playlists that can be propagated to the home screen on android - https://forum.kodi.tv/showthread.php?tid=332589

But, not much more on the subject that I can find, I would like to detect when kodi is launched from this intent within the skin or a service addon so that kodi can act in a different way.

Thanks for any links or info you can pass along.
Reply
#2
with the lack of documentation i traced through this but i still dont see where it sets any variables that can be checked from an addon or the skin

kodi receives an android intent android.intent.action.GET_CONTENT

which is handled by https://github.com/xbmc/xbmc/blob/master....cpp#L1410

with the url in the data videodb://movies/titles/337?showinfo=true

the servicebroker calls activatewindow https://github.com/xbmc/xbmc/blob/master...r.cpp#L779

which calls activewindow_internal https://github.com/xbmc/xbmc/blob/master...r.cpp#L795


and none of that helps me figure out when kodi is called from this intent vs normal user operation from within a kodi addon or in the skin
Reply
#3
still dont see anywhere that there is a flag or variable set when this is called from an intent

is this not the right place to ask for details on the code? i would have thought the development section would have been where to ask how the code functions ...
Reply
#4
Yes but we don't have a huge number of active dev's at the moment, and the only active regular Android contributor is not a Team member so I don't believe they visit here. If I remember rightly you have a FireTV device so going by https://github.com/xbmc/xbmc/pull/23177 I don't think it has the Android API for channels.

In case you are not aware, when it comes to Android then there's also the JNI wrapper library which gives access to the Android API's at https://github.com/xbmc/libandroidjni
Reply
#5
(2023-07-24, 17:09)jjd-uk Wrote: Yes but we don't have a huge number of active dev's at the moment, and the only active regular Android contributor is not a Team member so I don't believe they visit here. If I remember rightly you have a FireTV device so going by https://github.com/xbmc/xbmc/pull/23177 I don't think it has the Android API for channels.

In case you are not aware, when it comes to Android then there's also the JNI wrapper library which gives access to the Android API's at https://github.com/xbmc/libandroidjni

thank you

i do have firetv primarily but im testing a rocktek with android 11/android tv launcher right now which gave me the unexpected behavior of propagating playlists from kodi into the home screen launcher

which is what brought this around, it opens kodi and shows the information dialog for the video - https://github.com/xbmc/xbmc/blob/master....cpp#L1421

the call android is making to kodi is the equivalent of issuing an adb command - adb shell am start -n org.xbmc.kodi/.Main -a android.intent.action.GET_CONTENT -d "videodb://movies/titles/337?showinfo=true"

and originates somewhere here - https://github.com/xbmc/xbmc/blob/master...PC.java.in


spending time back tracing this i dont believe it sets anything in kodi that is detectable within kodi

what the desired behavior would be is to have a variable set that can be used within skins or addons like System.StartupWindow

maybe this -

have a System.StartupMethod which could be "from intent" or empty when the user has executed kodi

then a System.StartupIntent set to "android.intent.action.GET_CONTENT"

and a System.IntentData set to "videodb://movies/titles/337?showinfo=true"


so that when called in this way it is possible to create more actions from an addon or the skin and bridge the gap between android and kodi
Reply
#6
i suppose the end goal might shed light on this

it would be preferable to have the action taken user configurable instead of defaulting to showinfo, i made some modifications to a custom build

here https://github.com/xbmc/xbmc/blob/master....cpp#L1427

i changed the if clause to only require showinfo=true to be present and set to true in order for the resulting action to be "showinfo"

if (targeturl.GetOption("showinfo", value) && value == "true")

we are already only acting on intents GET_CONTENT and action.VIEW due to the if clause above it

so when issuing the same intent without showinfo=true, requiring both showinfo and the param true it performs the show information function as it used to

omitting showinfo=true it falls to the else here - https://github.com/xbmc/xbmc/blob/master....cpp#L1450

now we can start playback using -
am start -n org.xbmc.kodi/.Main -a android.intent.action.GET_CONTENT -d "videodb://movies/titles/337?showinfo=false"
or
am start -n org.xbmc.kodi/.Main -a android.intent.action.GET_CONTENT -d "videodb://movies/titles/337"
(instead of showing info)

i made 1 more modification here to resume playback instead of asking, again should be user configurable but since im building it im the user and using my preference - https://github.com/xbmc/xbmc/blob/master....cpp#L1456
item->SetStartOffset(-1); //STARTOFFSET_RESUME

i wasnt sure what to include to get the constant so i just hard coded it and noted its intended constant name

now if i can figure out how to detect this operation i would like the skin (Estuary) to be able to skip the home screen from Startup.xml if we are automatically starting playback

so, Startup.xml becomes this -

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <onload condition="String.IsEmpty(System.StartupIntent)">ReplaceWindow($INFO[System.StartupWindow])</onload>
    <onload condition="!String.IsEmpty(System.StartupIntent)">ReplaceWindow(fullscreenvideo)</onload>
    <controls />
</window>

at this point the decision can be made by VideoFullScreen.xml to return to the Home window or simply Quit() kodi when playback stops, returning instead to the android Home - assuming it was started from the intent


as soon as i figure out how to introduce a variable like startupintent i should have this working - in my own copy
Reply
#7
(2023-07-19, 01:18)jepsizofye Wrote: I found this single post on how to create playlists that can be propagated to the home screen on android - https://forum.kodi.tv/showthread.php?tid=332589

But, not much more on the subject that I can find, I would like to detect when kodi is launched from this intent within the skin or a service addon so that kodi can act in a different way.

Thanks for any links or info you can pass along.

For detecting when Kodi is launched from an intent on Android, refer to the provided Kodi forum thread. Further information or links on this specific subject may require additional research or consulting Kodi's official documentation and support channels.
Reply
#8
(2023-07-31, 08:45)Dukar Wrote: For detecting when Kodi is launched from an intent on Android, refer to the provided Kodi forum thread. Further information or links on this specific subject may require additional research or consulting Kodi's official documentation and support channels.

What a load of generic useless crap...

Stop 'reviving' old forum threads with apparent short AI/GPT texts that no one really wants, or the forum mods will find their nuke-a-forum-user button pretty quickly.
Reply
#9
Solved*

No more replies needed, especially non-sense ones like from Dukar
Reply

Logout Mark Read Team Forum Stats Members Help
Is there any documentation available for Kodi Channels on the Android TV Launcher?0