How to create new file on external USB Mass Storage device on a Samsung TV with Tizen 5.0 with Xamarin.Forms?

How to create new file on external USB Mass Storage device on a Samsung TV with Tizen 5.0 with Xamarin.Forms?

BY 23 Sep 2020 Tizen .NET

Hello!

I’m trying to create a new file with Xamarin.Forms on an external USB mass storage but I get an exception.

System.UnauthorizedAccessException: Access to the path ‘/opt/media/USBDriveA1/hello.txt’ is denied. —> System.IO.IOException: Permission denied

I believe I sign the app with a public certificate but I’m not sure I did the config right. I also added the following privileges to the tizen-manifest.xml:
http:// tizen.org/privilege/externalstorage
http:// tizen.org/privilege/mediastorage

I have the Tizen.NET nuget package in the multiplatform Xamarin.Forms project and the Tizen.NET.TV in the Tizen.TV project.

I tried with calling File.WriteAllText(“/opt/media/USBDriveA1/hello.txt“, “world”) from the multiplatform project but it gave me the above exception.

I saw that the Web API has functionality to read and write files, is this possible from Tizen.NET?

Thanks in advance!

 

 

Written by