I have a Xamarin Android App where I want to create a txt file that is editable by another app
For now, I've successfully created the file with this code
string content = "this is content of the file";
string path = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "Documents");
File.WriteAllText(path, content);
But I can not edit that file with another App like TurboEditor or by Windows Notepad (if I connect my device to a windows machine). It seems like the file is set to readonly, and only my app can edit it.
TurboEditor throwing exception
Permission Denial:Writing com.sec.android.app.myfiles.external.providers.MyFilesFileProvider uri content://com.sec.android.app.myfiels.FileProvider/device_storage/Documents/file.txt from pid=895, uid-10219 requires the provider to be exported, or grantUriPermission()
So how can I achieve this?
NB :
- I cannot edit the file, but I can delete it from android file explorer
- I create the file on
External StorageinDocumentsfolder - TurboEditor is an app just like Notepad but on android, it's available on playstore