CSharpShellApp
CSharpShellApp copied to clipboard
Permission handling routine
I had some trouble to code a simple permission check and message routine, and i hope somebody here has a solution, because i not get it done after many days of work. The examples fount in the internet not work at all, seams cshell can not handle the project files and some of the commands, and there is simply too much missing or different.
So i ask here if somebody has a solution for a theoretically simple permission routine for cshell. It should only check if a permission like for example MANAGE_EXTERNAL_STORAGE exists, give a message and link to change the option if not, and handle a event if user change the option. This could be used then as a example code in cshell.
tanks much
@Alisis33 You can use Microsoft.Maui.ApplicationModel.Permissions
for most permissions.
MANAGE_EXTERNAL_STORAGE is granted differently via a specific Android Intent like this.
That is doable in the app, but a bit difficult, especially if you need storage access control flow early in the startup cycle.
However as you can see Android.OS.Environment.IsExternalStorageManager
should work for just checking it.
But yes, I should really add an example for permissions.
A exampe with the full routine would be very useful, I realy bitten my teeth out with this. and it should be not to complicated, but the soucres I found didn't work...
Many times internet sources and examples are so VS spesific that they not work on cshell.
A issue was too that MainActivity didn't work, for example OnCreate is not triggered.