Android Question OSMDroid and SDK 23+


Licensed User
Hi all,
yesterday I was revising an old project of mine based on the wonderful @warwound 's OSMDroid (rel. 4.1) library.
It has a "dangerous" permission (WRITE_EXTERNAL_STORAGE) because it's able to store map tiles in a cache to work off-line.
Once I added the RuntimePermissions library to my code, modified the Manifest to list the dangerous permission and requested the safe GetSafeDirDefaultExternal("") directory, I found there seems to be no way to tell OSMDroid to use it for its caching.
I searched the forum and one message shows that the use of the cache-dir is hard-coded in the original library and somewhat scattered in it, so there was no easy way to change it.

Does all the above mean OSMDroid will be unusable on newer devices (I still usa a 4.4 smartphone)?
I mean, unusable if I set "targetSdkVersion" to 23+ or eventually need to publish my app on the Store when Google will force the "26 boundary".

This is a check made in Activity_Create:
If File.ExternalWritable=False Then
       '   OSMDroid requires the use of external storage to cache tiles
       '   if no external storage is available then the MapView will display no tiles
       ToastMessageShow("No valid storage for maps on the device!",True)
End If

TIA for your comments.

Last edited:


Licensed User
Do you mean just use rp.CheckAndRequest along with the setting in the Manifest and forget about the dir?
Upvote 0