Properties Dictionary and Backup

ZoliZoli NLMember ✭✭✭

Hi,
Properties Dictionary looks a very simple but powerful feature, it perfectly fits to my needs to store my App data (as XML) instead of using SQLite.
However, what about platform specific backups?

Android
Auto Backup (from 6.0):
By default, Auto Backup includes almost all of the app's files (developer.android.com/guide/topics/data/autobackup.html#Files). You can use XML to include and exclude files.
Problem is, how can I know if "under the hood" Xamarin Dictionary file is backuped by the Android Auto-Backup? Where is this file stored, to check if it is included in the auto-backup?

iOS
Files in Application Sandbox are backuped, so I guess Xamarin Dictionary file is backuped as well?

Best Answer

  • ZoliZoli NL ✭✭✭
    Accepted Answer

    I could not figure out the exact platform implementation of IsolatedStorageFile. It resides maybe in Mono?
    Anyway, I tracked back the filesystem on my device, and App.Current.Properties is stored in /data/data/[your.app.package]/files/.config/.isolated-storage file.
    As this folder is covered by Files in the directory returned by getFilesDir(). as an Android Backup target, so it seems Xamarin properties are also backuped.

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @Zoli - if you ever want to know what happens "under the hood", the Xamarin.Forms source code is available at https://github.com/xamarin/Xamarin.Forms

  • ZoliZoli NLMember ✭✭✭

    @JohnHardman - thanks, but this is the furthest point I can get:
    Xamarin.Forms.Platform.Android/Forms.cs:

        public IIsolatedStorageFile GetUserStoreForApplication()
        {
            return new _IsolatedStorageFile(IsolatedStorageFile.GetUserStoreForApplication());
        }
    

    Here, IsolatedStorageFile.GetUserStoreForApplication() from MSDN: (msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.getuserstoreforapplication(v=vs.110).aspx)

    Obtains user-scoped isolated storage corresponding to the calling code's application identity.

    :|

  • ZoliZoli NLMember ✭✭✭
    Accepted Answer

    I could not figure out the exact platform implementation of IsolatedStorageFile. It resides maybe in Mono?
    Anyway, I tracked back the filesystem on my device, and App.Current.Properties is stored in /data/data/[your.app.package]/files/.config/.isolated-storage file.
    As this folder is covered by Files in the directory returned by getFilesDir(). as an Android Backup target, so it seems Xamarin properties are also backuped.

Sign In or Register to comment.