apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Default values are not created/set on Android #62

Open bitflower opened 8 years ago

bitflower commented 8 years ago

Default values set in the app-settings.json and later baked into the xml file fine are not being applied to the preferences on the device.

As it turns out these have to actively be set by a command as described here: http://stackoverflow.com/questions/6171155/defaultvalue-from-xml-preference-file-isnt-stored-why

I guess this belongs in the AppPreferencesActivity.template ?

apla commented 8 years ago

I see, default values need to be copied to the preferences at first launch of application. Best way to resolve this is to check for a specific key in preferences (like apppreferences.defaults.copied) at plugin initialization and if it is not set, copy every preference value from xml.

bitflower commented 8 years ago

Ok, did you mean to implement this or did you mean that I should have a look into it ? :-) not to make the same addition twice!

I'm not a java developer, thats the "problem"....

apla commented 8 years ago

Currently I don't have time to implement this. And I am not an android developer too -)