You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relatively new to Xamarin. Trying PCLstorage as a quick and easy way to get text files working. Have succeeded with using LocalStorage on Android/iOS/UWP, however comes up with "System.NullReferenceException: Object reference not set to an instance of an object" if I try to use RoamingStorage on Android/iOS (it does work for UWP however). I am wanting to have user-accessible files, and I'm presuming using the RoamingStorage option is the way to do it? (LocalStorage is definitely NOT user-accessible on Android - doesn't seem to matter with UWP).
The text was updated successfully, but these errors were encountered:
publicIFolderRoamingStorage{get{
#if ANDROID||IOSreturnnull;
#else
// SpecialFolder.ApplicationData is not app-specific, so use the Windows Forms API to get the app data path//var roamingAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);varroamingAppData=System.Windows.Forms.Application.UserAppDataPath;returnnewFileSystemFolder(roamingAppData);
#endif
}}
to
publicIFolderRoamingStorage{get{
#if ANDROIDvarroamingAppData=Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
#elif IOSreturnnull;
#else
// SpecialFolder.ApplicationData is not app-specific, so use the Windows Forms API to get the app data path//var roamingAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);varroamingAppData=System.Windows.Forms.Application.UserAppDataPath;
#endif
returnnewFileSystemFolder(roamingAppData);}}
and it seems to work.
Since i don't have a mac, i can't change the IOS version.
Maybe someone can come up with an IOS solution.
Thanks, but how do I navigate to that page you have mentioned? (I haven't updated an external package before - I've been looking around, but can't see where this is, in VS2017 or in Windows) If I can find it then I can have a go at the iOS version (since I do have access to a Mac)
Isn't RoamingStorage the place where you put data to be stored in the 'cloud; or somewhere as part of the user profile and you expect to be restored if the user installs your app in a different machine? If so, it doesn't look to me that the https://developer.xamarin.com/api/property/Android.OS.Environment.ExternalStorageDirectory/ is the right place. Just my 2 cents,
Hi,
Relatively new to Xamarin. Trying PCLstorage as a quick and easy way to get text files working. Have succeeded with using LocalStorage on Android/iOS/UWP, however comes up with "System.NullReferenceException: Object reference not set to an instance of an object" if I try to use RoamingStorage on Android/iOS (it does work for UWP however). I am wanting to have user-accessible files, and I'm presuming using the RoamingStorage option is the way to do it? (LocalStorage is definitely NOT user-accessible on Android - doesn't seem to matter with UWP).
The text was updated successfully, but these errors were encountered: