Posts: 67
Joined: Oct 2013
Reputation:
3
Quick question... is there a way for an addon to find out which platform it's running on?
Basically I want to know if the addon is running on Android as in that case I need to handle settings differently so would be useful if it was possible.
Thanks in advance!
Posts: 3,544
Joined: Mar 2010
Reputation:
119
From memory xbmc.getCondVisibility('system.platform.android') returns true for linux and android (though I last tested on gotham), which is why I use
if osAndroid:
osLinux = 0
Posts: 2,078
Joined: Nov 2012
Reputation:
176
enen92
Team-Kodi Member
Posts: 2,078
I also use the boolean conditions for this and also came across this "problem" between android and linux. Android is detected as both linux and android but linux never reported as android so, it's quite easy to overcome.
if xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.android') --> Linux
if xbmc.getCondVisibility('system.platform.linux') and xbmc.getCondVisibility('system.platform.android') --> Android
Always thought it worked this way on purpose due to the linux kernel in android.