HELP: KODI window foreground tracking when lanching Android app from KODI favorites
#1
Issue:
I'd like to track when an Android app is launched from the favorites bar and KODI is no longer in the foreground. Conversely, I'd also like to track when KODI gets focus back after the Android app is closed.

Right now, I don't see any event packets being sent over the tcp port when an Android app is launched from within KODI's interface (e.g. using favorites only; I can't add a custom home shortcut to the app as the version of Confluence skin only supports adding addons to the home screen).

All other events are working fine for me.

What I'm trying to do:
I want to switch to Android tcp based control navigation when KODI no longer has foreground and KODI has been used to launch an android app from favorites. An app such as LANmote Deluxe or something similar would be used for when KODI is not in the foreground after the Android app is launched. This is because KODI's JSON-RPC can't be used to navigate android apps. The control switch between KODI JSON-RPC and LANmote would happen on my home automation server, and would be transparent to the user. When KODI is back in the foreground, KODI JSON-RPC would be used.

Background:
I'm trying to build an opensource module for a free home automation program called Motorola Premise (http://cocoontech.com/forums/page/home-a...premise-r3).

I'll post my work for others to use once everything is complete! The thread for the module is here: http://cocoontech.com/forums/topic/28413...c-support/

What I have now as a test bed is a NVidia Shield running KODI from the google play store. I am a first time KODI user, but I've built and posted ~20 opensource home automation modules on cocoontech.

I'm very impressed with KODI and the JSON-RPC protocol so far, aside from this one little gotcha.
Reply
#2
I'm surprised there's no way to do this. The NVidia Shield has Netflix 4k built in, and opens and closes seamlessly with KODI.

I just need some way to tell if KODI has lost focus in the foreground Sad
Reply
#3
I'm still stumped on this one. Please help...

I figured out that I can use the IR pronto hex codes for the nvidia shield to control the stock 4k netflix app, so the problem of how to control the Shield box over the network when KODI is not in the foreground is easy with the Global Cache WIFI2IR box.

However, I'm still stumped ed on how to get KODI to send a json event packet when it gains foreground focus and when it loses foreground focus.
Reply
#4
(2015-08-16, 19:51)etc6849 Wrote: I'm still stumped on this one. Please help...

I figured out that I can use the IR pronto hex codes for the nvidia shield to control the stock 4k netflix app, so the problem of how to control the Shield box over the network when KODI is not in the foreground is easy with the Global Cache WIFI2IR box.

However, I'm still stumped ed on how to get KODI to send a json event packet when it gains foreground focus and when it loses foreground focus.

I utilise the LANmote Android App and replicate the HTTP commands to achieve IP based control over the Android OS. Like you though i have issues with determining if Kodi is in the foreground or not.
Reply
#5
I'm thinking about side loading Tasker on my Android TV, and seeing if Tasker can tell my home automation system which app has focus.

I know my EventGhost home automation module can do what we need easily under Windows, but EG doesn't run under Android Sad

LANmote is an option, the reason I chose to use IR to control the native 4k Netflix app on the Nvidia Shield is because I didn't want to root it yet.

PS: I posted the KODI module for others to use under the description of this YouTube video:



(2015-10-09, 05:53)alanchow Wrote: I utilise the LANmote Android App and replicate the HTTP commands to achieve IP based control over the Android OS. Like you though i have issues with determining if Kodi is in the foreground or not.
Reply

Logout Mark Read Team Forum Stats Members Help
HELP: KODI window foreground tracking when lanching Android app from KODI favorites0