-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full working Sample #10
Comments
ApplicationRootFolder is not supported on all platforms. |
I am using something like:
and I'm getting a path I can work with. |
Same problem here on UWP - Android and iOS are working without problems. |
We have a pull request that I hope should fix UWP |
Should be working with 1.3.2 now |
1.3.2 crashes on Android and throws an UnauthorizedAccessException on UWP. :-( |
Can you provide the code that crashes on Android? |
Sure, here - crash in the 2nd line. var rootFolder = new ApplicationRootFolder(); var draftFile = await folder.GetFileAsync(ServiceRequestDraftJson); |
|
@Aragas thanks for die fast reply. Which IFolder-Implementation is supported on all platforms? |
I guess the |
DocuementsRootFolder works with 1.3.1 on Android but 1.3.2 crashes. |
Interesting. Code to reproduce? |
@Aragas Same code as yesterday - only ApplicationRootFolder replaced by DocumentsRootFolder. |
Strange issue. Should work in both versions |
Use LocalRootFolder to store your app data or RoamingRootFolder (in case you need roaming) or TempRootFolder (for temp files). |
When I use LocalRootFolder, it gives the path as, /storage/emulated/0/Android/data/com.companyname.AppName But generally all the apps folders are under /storage/emulated/0 Just as example |
@imhrushi you could try |
Thanks Aragas, I was able to use that folderfrompath. But now when I try to create a folder using that class object, it gives me error access denied. I suppose I have to check and ask for the runtime storage permissions? the code on the net for this needs Xamarin.Android.Support.Compat package and in turn that needs monoandroid framework. Now my xamarin forms in visual studio does not have this framework. Do I need to download it and install in order to do this all stuff? |
@imhrushi check first if your app has read&write permissions for external storage. If you have, then maybe you need to ask for the actual permissions from the user. Check this library for a sample https://github.com/jamesmontemagno/PermissionsPlugin/blob/master/README.md |
Hi,
I tried to replace PCLStorage with PCLExt.FileStorage and found the JSON and Log examples, but I didn't get it working.
I want to do something like:
But I always get a NullReference Exception on rootFolder.
I'm using a Xamarin.Forms Solution with UWP, Android, iOS and .netstandard2.0 libararies (refer to the latest Prism Template Pack).
I also tried to instantiate the root folder directly in the several platform project without success.
The library is installed via nuget in the main project, the three platform projects (UWP, Android, iOS) and one or two libraries.
What I'm doing wrong? Is it possible to get a full working sample solution?
The text was updated successfully, but these errors were encountered: