Kodi Community Forum

Full Version: Launch default application on Android from Kodi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I want to make an addon that reads directories where I have several files of different formats (pdf, epub, cbr, etc).

I would like to click on one of them and launch default application that has Android for that type of file will be launched.

I have tried a little of everything, but they all failed me.

# It only works on Windows
os.startfile (path)
# Does nothing
os.system ('xdg-open "' + path + '"')
#Does nothing
os.system ('start "' + path + '"')
#Does nothing
os.system ('open "' + path + '"')
#Permission denied
subprocess.call (['xdg-open', path])
#Permission denied
subprocess.call (['open', path])
#Does nothing
webbrowser.open (path, new = 0, autoraise = True)
# The closest, but open Chrome, although from the explorer I have indicated that this type of file (epub in the test, it would open with an APK already installed)
xbmc.executebuiltin ("StartAndroidActivity (,,," + path + ")")

As you can see, I never tell it with which application to open the file, because the idea is to open it with the application that has been set in Android for such files.

Any help / ideas please?

Thanks for your attention.