Kodi Community Forum

Full Version: Check app installed on android?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In android, I want to load the LocalCast app from Kodi via the command line, this I can do! But first I need to verify that the app is installed.

How to check if a certain app is installed on android?
Hi,

I am not at all experienced with android development.

But based on your issue, if you can figure the code side of this solution, then one easy solution I can think of is to check if the org.xbmc.kodi folder exists within the directory sdcard > android > data folders in android.

I would make use of python's import os to do this, by checking to see if the directory path, or the folder exists.

I am pretty sure this is not the type of solution your looking for but it could be a quick and dirty way to easily check I guess.

Hope this helps.
Thanks for the tip, I was able to implement the function I needed!

Code:
addon_id = 'plugin.video.myAddon_NAME'
selfAddon = xbmcaddon.Addon(id=addon_id)
addonfolder = selfAddon.getAddonInfo('path')
addon_dir = xbmc.translatePath( selfAddon.getAddonInfo('path') )

appDir = addon_dir.split('org.xbmc.kodi')[0] + 'de.stefanpledl.localcast'
if os.path.exists(appDir):
    #my code...
(2017-08-09, 00:20)antrrax Wrote: [ -> ]Thanks for the tip, I was able to implement the function I needed!

Code:
addon_id = 'plugin.video.myAddon_NAME'
selfAddon = xbmcaddon.Addon(id=addon_id)
addonfolder = selfAddon.getAddonInfo('path')
addon_dir = xbmc.translatePath( selfAddon.getAddonInfo('path') )

appDir = addon_dir.split('org.xbmc.kodi')[0] + 'de.stefanpledl.localcast'
if os.path.exists(appDir):
    #my code...

Hello,

Thats great to hear,

I also just realised, that my answer was sort of wrong, the folder that I asked you to check was Kodi's folder itself, when actually you were asking for the LocalCast app, however, as long as you got what I meant, which was to look for the related folder for the local cast app, found within the directory sdcard > android > data folders in android, you should be fine.

lol, if I am honest based on your code, I am not sure what your doing from the point where you declare appDir variable (I am still a newb Smile), but as long as its working for you all the best Smile