Jump to content
  • 0

Launching Android Apps from Nvidia Shield via Action

Question

How would you best recommend accomplishing this? I was thinking of using python and the StartAndroidActivity() function, but I was running into errors. Has anyone successfully figured out how to launch an app?

I'm basically wanting to launch VLC on sequence pause with a pseaction to emulate a commercial since we dont have the function to add markers mid-features yet.

Edit: Bonus points if you know how to launch a video already playing - I'm thinking of using tasker to auto play video once VLC launches.

Edited by DIYTVKodi
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I ended up using an outside app to solve for this, Tasker and Button Mapper. I used tasker to create a task that opens an "android android.intent.action.VIEW", and Button Mapper to toggle that task with my preferred shortcut. Before creating the task I cleared my default players so the first time it ran, the shield would ask me which media player I'd like to use (and set as default).

Basically the Tasker task is as follows:

  1. Intent Action to Open Video using "android.intent.action.VIEW" and file:///storage/emu.../0/Download/MyVideo.mp4 (there's prob another setting I'm forgetting here)
  2. Wait Action - Set to 38 seconds
  3. Back Button Action
  4. Wait Action - Set to 77ms
  5. Back Button Action
  6. Switch Focus to Previous App Action

By default, Kodi will pause whatever video if you open another app and it loses focus, so setting up the whole task chain was pretty easy.

Edit: Another key was finding a video player that will allow you to toggle a setting to "quit" the app if you press back twice - in my case, I ended up using MX player. If you cant quit the player like this, it will just try to resume the video again if its not quit properly the next time you toggle the commercial.

Edit 2: Be mindful that if you wait too long, Android might decide to kill Kodi cause its eating up too much ram. So if you're using this strategy, try to kill as many background apps as possible if you want a longer commercial.

Edited by DIYTVKodi
Add task details
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • 0

 Share

×
×
  • Create New...