Open r4sas opened 3 years ago
Technically this may cause several issues on the devices running Android 11 which introduces many restrictions on using the files from other applications, including internal memory and SD card. Currently OSMDroid (the map control I use) is not fully compatible with Android 11, see this issue for example.
In that case do it switchable, with logic depending on system version.
OSM tiles from installed OsmAnd
check if OsmAnd app installed and use map tiles from it
OsmAnd doesn't (ordinarily, by default) use tiles (raster images), but vector data (in OBF format, along with routing data) which it renders locally. Besides needing vector map data for routing, element tags are also needed for its in-app search (for PoIs) feature. The format isn't well-documented, either, from what I've read.
Pre-rendered tiles are probably the best (simplest) option for Tower Collector. A map is a secondary feature in this context. Tower Collector isn't about navigation, but collecting data. A map is a convenience feature.
OSM map tiles are quite lean (byte-count, because that's in everyone's interest). They don't require much storage unless viewing a wide area in detail.
If storage is a concern, then reduce (or disable) the cache (but that'll use more network data).
I doubt it's technically possible to implement this feature on latest Android versions because Google limits access to several functions in the API, for example ability to query installed applications, officially for privacy reasons.
Relevant I hope there is some solution to this issue
Current implementation uses own tiles loading, but it can be good idea to check if OsmAnd app installed and use map tiles from it. That can prevent excessive tiles download and reduce internal space usage.