0 rating
  • 1
  • 2
  • 3
  • 4
  • 5
Compatible with
  • Android
  • iOS

Advexp.Settings Cloud 2.1.6

Alexey Ivakin

Create cross-platform settings, save locally or to the cloud and sync them across iOS or Android devices.

Advexp.Settings Cloud

Create cross-platform settings and make them accessible in your iOS or Android application. Ability to save the settings locally or to the cloud and sync them across the different devices by using the Amazon Cognito Sync service

  • iOS: Storing settings in a normal form using NSUserDefaults
  • iOS: Storing settings in an encrypted form using Keychain
  • Android: Using SharedPreferences to store settings in a normal form
  • Android: Using KeyStore to save confidential settings in an encrypted form
  • Using the Amazon Cognito Sync service to save the settings to the cloud and sync them across the different devices
  • Using user storage for settings
  • Using any build-in or user-defined types which can be saved as a setting
  • iOS: Ability to link settings from Advexp.Settings with settings from the Settings App
  • iOS: The possibility of using InAppSettingsKit along with Advexp.Settings. Both for creating fully functional GUI of the app settings and for locating them in the Settings App and accessing them from C# code.
  • Using library in PCL projects
  • Saving or loading settings by using JSON. In this case, the additional component Json.NET is used

NuGet package “Advexp.Settings Local” you can download from the site:
https://www.nuget.org/packages/Advexp.Settings.Local

NuGet package “Advexp.Settings Cloud”, evaluation version, you can download from the site:
https://www.nuget.org/packages/Advexp.Settings.Cloud.Evaluation

"Advexp.Settings Local" component for Xamarin you can find here:
https://components.xamarin.com/view/advexp-settings-local

Samples and Unit Tests you can find here:
https://bitbucket.org/advexp/component-advexp.settings

Example of a settings declaration

[Advexp.CognitoSyncSettings.Plugin.
 CognitoSyncDatasetInfo(Name = "MyCognitoSyncDatasetName")]
class Settings : Advexp.Settings<Settings>
{
    [Advexp.CognitoSyncSettings.Plugin.
     CognitoSyncSetting(Name = "CognitoSyncSettings.Boolean", Default = false)]
    public static Boolean CognitoSyncBoolean {get; set;}

    [Advexp.
     Setting(Name = "IntSetting", Default = 3)]
    public static Int32 IntSetting {get; set;}

    [Advexp.
     Setting(Name = "NonStaticStringSetting", Default = "default string value")]
    public String NonStaticStringSetting {get; set;}

    [Advexp.
     Setting(Name = "SecureDateTimeSetting", 
                    Secure = true, 
                    Default = "2009-06-15T13:45:30.0000000Z")]
    public static DateTime SecureDateTimeSetting {get; set;}

    // In this case, the automatic setting name in storage will be
    // "{NamespaceName}.{ClassName}.{FieldName}"
    // The name pattern can be changed 
    // using the SettingsConfiguration.SettingsNamePattern property
    // The default pattern name is: "{NamespaceName}.{ClassName}.{FieldName}"
    [Advexp.
     Setting]
    public static String SettingWithAutoName {get; set;}
}

Example of settings usage

class Application
{
    static void Main(string[] args)
    {
        Advexp.
            SettingsBaseConfiguration.RegisterSettingsPlugin
            <
                Advexp.CognitoSyncSettings.Plugin.ICognitoSyncSettingsPlugin,
                Advexp.CognitoSyncSettings.Plugin.CognitoSyncSettingsPlugin
            >();

        Advexp.CognitoSyncSettings.Plugin.
            CognitoSyncSettingsConfiguration.Config = new AmazonCognitoSyncConfig()
            {
                RegionEndpoint = Amazon.RegionEndpoint.USEast1
            };

        Advexp.CognitoSyncSettings.Plugin.
            CognitoSyncSettingsConfiguration.Credentials = 
                new CognitoAWSCredentials("MyIdentityPoolId", Amazon.RegionEndpoint.USEast1);

        Advexp.CognitoSyncSettings.Plugin.
            CognitoSyncSettingsConfiguration.Credentials.AddLogin(
                "MySyncProviderName", "MyAccessToken");

        Settings.LoadSettings();

        // Will be saved to Amazon Cognito Sync
        // and will be available for syncing to another device
        Settings.CognitoSyncBoolean = true;
        // Will be saved to NSUserDefaults for iOS 
        // and to SharedPreferences for Android
        Settings.IntSetting = 5;
        Settings.Instance.NonStaticStringSetting = "Data1";
        Settings.SettingWithAutoName = "Data2";
        // Will be saved to Keychain for iOS and to KeyStore for Android
        Settings.SecureDateTimeSetting = DateTime.Now;

        Settings.SaveSettings();

        // If needed, you can force the Cognito Sync container 
        // to perform synchronization
        var plugin = Settings.GetPlugin<ICognitoSyncSettingsPlugin>();
        plugin.SynchronizeDataset();
    }
}

The evaluation version of the component does not allow specifying the name of the Cognito Sync dataset and uses the name "Advexp.Settings.Evaluation"

Supported platforms

Xamarin.iOS (Unified)
Xamarin.Android

PCL projects

NuGet package “Advexp.Settings Local” you can download from the site:
https://www.nuget.org/packages/Advexp.Settings.Local

NuGet package “Advexp.Settings Cloud”, evaluation version, you can download from the site:
https://www.nuget.org/packages/Advexp.Settings.Cloud.Evaluation

"Advexp.Settings Local" component for Xamarin you can find here:
https://components.xamarin.com/view/advexp-settings-local

Samples and Unit Tests you can find here:
https://bitbucket.org/advexp/component-advexp.settings

Please send your questions, suggestions and impressions to components@advexp.net with the subject "Advexp.Settings"

Release Notes

  • bug fixing
Be the first to write a review