- Posts: 189
- Thank you received: 12
Does myServer know when an App is launched?
- cjisble
- Topic Author
- Offline
- User
-
Less
More
2 years 2 days ago #3058
by cjisble
Does myServer know when an App is launched? was created by cjisble
I am using the AndroidTV Driver to control my Shield. I am also running Kodi on the Shield, and use the Kodi Driver for it.
The problem is that if you start Kodi from the Shield home screen, the remote is not on the right page for controlling Kodi.
The simplest solution I could come up with is to remove Kodi from the Favorites on the Shield. This makes going to the home screen on the remote the easiest way to start Kodi.
But that made me wonder. Is there an event that the server could monitor such that I could automatically send the remote to the right page if Kodi is launched from the Shield?
The problem is that if you start Kodi from the Shield home screen, the remote is not on the right page for controlling Kodi.
The simplest solution I could come up with is to remove Kodi from the Favorites on the Shield. This makes going to the home screen on the remote the easiest way to start Kodi.
But that made me wonder. Is there an event that the server could monitor such that I could automatically send the remote to the right page if Kodi is launched from the Shield?
Please Log in to join the conversation.
- Nillaz
- Offline
- User
-
Less
More
- Posts: 443
- Thank you received: 36
2 years 2 days ago #3059
by Nillaz
Replied by Nillaz on topic Does myServer know when an App is launched?
There is a command in the AndroidTV driver called Monitor and it says that it is for device app monitoring, but I don't know how it works.
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 1 day ago #3060
by bowlingbeeg
Replied by bowlingbeeg on topic Does myServer know when an App is launched?
One way to do this would be to have Kodi call a script during startup that would send an API request to MyServer6 to load the correct scene on the remote. I can't say I've done it but I'm pretty sure it can be done that way.
Please Log in to join the conversation.
- cjisble
- Topic Author
- Offline
- User
-
Less
More
- Posts: 189
- Thank you received: 12
2 years 1 day ago #3063
by cjisble
Replied by cjisble on topic Does myServer know when an App is launched?
The more I think about this, the harder it seems.
The problem with a Kodi startup script is that it is possible to exit the Kodi app without shutting down Kodi. So, the next time you open the app, it returns you to where you left off. No startup script on reentry.
And this made me realize that I'm going to have the same problem, in reverse, when I close the Kodi app. I'm going to want the remote to go back to the Shield screen.
Without the ability to react to the opening and closing of the Kodi app, I only see two alternatives:
1. Don't use the Kodi driver. Get a Video Storm IRUSB and use keyboard commands to control Kodi above and beyond the basic Shield remote.
2. Don't run Kodi on the Shield. Purchase a dedicated box to run Kodi. And if I go this route, it might be better to take the money I would have spent on the IRUSB and put it towards the purchase of an Apple TV.
The problem with a Kodi startup script is that it is possible to exit the Kodi app without shutting down Kodi. So, the next time you open the app, it returns you to where you left off. No startup script on reentry.
And this made me realize that I'm going to have the same problem, in reverse, when I close the Kodi app. I'm going to want the remote to go back to the Shield screen.
Without the ability to react to the opening and closing of the Kodi app, I only see two alternatives:
1. Don't use the Kodi driver. Get a Video Storm IRUSB and use keyboard commands to control Kodi above and beyond the basic Shield remote.
2. Don't run Kodi on the Shield. Purchase a dedicated box to run Kodi. And if I go this route, it might be better to take the money I would have spent on the IRUSB and put it towards the purchase of an Apple TV.
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 1 day ago #3066
by bowlingbeeg
Replied by bowlingbeeg on topic Does myServer know when an App is launched?
Wonder if you could write a python script to send adb commands to the shield to figure out which app was in focus. A quick google search turned up this webpage that had some examples of adb commands that seemed like they might get you what you want.
www.repeato.app/identifying-the-current-...-in-android-via-adb/
. You could then run an "automation" every so often that called a macro and used the "RunParseResults" command to take the output from the python script and stored it into a myServer variable.
Please Log in to join the conversation.
- andrew
- Offline
- User
-
Less
More
- Posts: 339
- Thank you received: 28
2 years 1 day ago #3068
by andrew
Replied by andrew on topic Does myServer know when an App is launched?
I think myServer automations can only be scheduled to run every minute at the most. That's why I ended up creating a Linux cron job that runs every 30 seconds to keep my Yamaha amp driver connection alive. You could do the same thing - have a cron job that runs every 15 seconds, checks what's running on the shield and uses the myServer doCommand web api to stuff the results into a variable.
Andrew
Andrew
Please Log in to join the conversation.
Time to create page: 0.175 seconds