Xamarin.Forms properties not saved in Android version

I use Xamarin.Forms and Application.Current.Properties to save user preferences. I am testing it on Android and it works great

  • in debug mode
  • in release mode with the linker setting set to No

But it does not work with the linker setting set to SDK Build Only . I test by deploying the APK file directly to the device. Then I try to enter some settings and restart the application - and after rebooting all settings will be lost. I do not use complex data types, only string and bool.

I found a workaround offered here: https://forums.xamarin.com/discussion/30723/problems-with-application-current-properties . He suggests ignoring the Xamarin.Forms.Core assembly, but that doesn't help.

If the linker configuration is set to No , the size of the APK is huge (50 MB!). I want to avoid this.

How can I save application properties in the Release assembly without setting the linker configuration to None? Is this a known Xamarin bug?

+5
source share
1 answer

, xamarin docs (https://developer.xamarin.com/guides/xamarin-forms/working-with/application-class/#Properties_Dictionary):

. . (, " " ).

- , , , JSON Newtonsoft.Json, "" ( , "" )


Btw, : Android. , .

+4

All Articles