Android setSetting() not working!?
#1
Hi there,

having a strange issue here...

In one of my addons I'm using
Code:
xbmcaddon.Addon().setSetting()

to save certain settings and it works fine on all platforms apart from Android.
There it does not seem to have any effect. No message in the logs, just no change to the setting I try to change.

Is that a known issue? Haven't found anything about it so have submitted a bug here already: http://trac.kodi.tv/ticket/15821

Anyone know of a workaround maybe?

Thanks a lot!
Reply
#2
Right... looks like it's been a known issue for 2 years already!

My bug report just got closed as a duplicate of this one: http://trac.kodi.tv/ticket/13913

Anyone got a workaround for me!?
Reply
#3
What Android version/device are you using to test the add-on?

I have a (rooted) Nexus 5 [5.0.1] with Kodi 14 and an AFTV Stick [4.2.2] with Kodi 14.1 and my add-on is able to change its setting using:
Code:
import xbmcaddon
addon = xbmcaddon.Addon()
addon.setSetting(id='port_number', value=str(port))

If you would like I could test the add-on on my device(s) to see if I experience the same issue.
Reply
#4
The devices I test with are a Galaxy S3 (running Cyanogenmod 11) with latest Kodi and a no-name Tablet (Android 4.1) also with latest Kodi.

If you'd like to test it on your devices that'd be highly appreciated!

You need version 2.0.13 of the addon here: https://github.com/bluezed/FTV-Guide-Rep...p?raw=true
In the latest version I've added a workaround specifically for Android by basically writing directly to the settings.xml... Not pretty but seems to work at least.

How to reproduce the issue:

1. Start the addon (needed for first initialisation)
2. Close it again
3. Open the addon-settings
4. Click on "XMLTV type"
5. Select one of the given options

Result:
The selected option should be shown next to "XMLTV type" and saved to the settings.xml once you click on "Ok" in the Settings dialogue.
This is the case with all platforms apart from the Android ones I tested with.
Reply
#5
My Nexus 5 is experiencing the mentioned issue with FTVGuide 2.0.13 and the Weather add-on.

Not that it will help but I noticed Kodi for Android seems to have an issue updating settings that exist in resources/settings.xml. I removed xmltv.type from resources/settings.xml and the add-on updated the value for xmltv.type in settings.xml; however, xml.type_select did not update. I modified the add-on to save the value as xmltv.type_ instead of xml.type_select to test it. It successfully added the setting xmltv.type_ with the string value in settings.xml. In either case it does not help resolve the issue because the setting is not visible. It seems like your workaround is the way to go for Android.

It is odd because my service add-on is able to update its setting when necessary and it is a setting I have in resources/settings.xml as a labelenum.

Removed from resources/settings.xml:
Code:
<setting id="xmltv.type" type="number" enable="false" visible="false"/>

userdata/addon_data/addon/settings.xml:
Code:
<settings>
    <setting id="addons.ini.file" value=""/>
    <setting id="addons.ini.type" value="0"/>
    <setting id="alternative.playback" value="false"/>
    <setting id="autostart" value="false"/>
    <setting id="enable.osd" value="true"/>
    <setting id="logos.enabled" value="true"/>
    <setting id="logos.folder" value=""/>
    <setting id="logos.source" value="0"/>
    <setting id="notifications.enabled" value="true"/>
    <setting id="skin" value="Default"/>
    <setting id="xmltv.file" value=""/>
    <setting id="xmltv.interval" value="2"/>
    <setting id="xmltv.type" value="1"/>
    <setting id="xmltv.type_" value="FTV (Basic)"/>
    <setting id="xmltv.type_select" value=""/>
</settings>
Reply
#6
Wow... Thanks for testing so thoroughly.

Even though it doesnt help I appreciate the effort.

Only real hope is they will fix this over 2 year old bug soon Sad
Reply

Logout Mark Read Team Forum Stats Members Help
setSetting() not working!?0