I realise there has been quite a lot written about files and the associated difficulty of accessing storage post Android 10 in particular - however I've not seen anything on KML files. I am developing an app that reads a Google sheet holding hills data which includes Lat / Log coordinates. For each line of the spreadsheet it produces KML script so that a pin and its associated 'balloon' can be displayed on Google Earth. I can get it to work on Android 6, but not Android 11, so I think re-coding is required. I have two questions: (1) Where is the best place in storage to save a KMl file? I have a couple of thoughts (a) should it be regarded as 'media' and stored under /storage/emulated/0/Documents or (b) an App specific location say /storage/emulated/o/Android/data/. I would like the KML file to persist if the App is uninstalled. (2) Given all the permissions issues (whicj I struggle to understand) is there any way to code this so that works for both Android 6 and Android 11?
BTW: After much reading, I've drawn the diagram below which is my understanging for Androd file storage - but if that is wrong then I'm not going to get very far. Comments welcome!