billthefarmer / tuner

Android accordion tuner
176 stars 55 forks source link

[idea] request SD card permissions on Android at run time #35

Closed raboof closed 5 years ago

raboof commented 5 years ago

It would be great if the tuner could switch to requesting SD card permission at run time (as it might not be relevant to everyone) as documented at https://developer.android.com/training/permissions/requesting.

Unfortunately that seems to require at least Android 6, and there's still a lot of people on older versions of Android (https://developer.android.com/about/dashboards/), so this probably has to wait.

billthefarmer commented 5 years ago

I have avoided using the support library in my apps because it adds about a MB to the size of the app for very little gain. It may be possible to use only parts of it for specific purposes, but I've seen no indication of that. There is only one line in the app that attempts to read a file - here. And promptly gives up if it fails.

billthefarmer commented 5 years ago

Having discovered that the support library is not necessary, I have added code to ask for permissions and to check both the Android/data/org.billthefarmer.tuner/files and the Tuner folders for a Custom.txt file.

If the android version is less than 6, the app will get both Microphone and Storage permissions by default. Depending on OS installed, you may be able to take them away again. If the file is in the Android/... folder it may get read anyway, but not in the Tuner folder. If the version is 6 or greater you will get asked for permissions. A file in the Android/... folder will get read without the Storage permission.

So if you don't want my horrid app to read your secret squirrel storage, you don't have to :smirk:

That will be in the next version.

raboof commented 5 years ago

Awesome! Thanks, good to know my squirrel will be secret again :smile_cat: ! Thanks for a great app!

billthefarmer commented 5 years ago

:squirrel: