This is truly weird. The problem seems to arise from the size of the bitmap which I found by accident when I wrote the simplest possible app to open an existing map image in the downloads folder. The entire program is below. I've tried this on two different devices, up to now I've been using the Huawei as it's larger size makes it more convenient for testing
Samsung A3 - Android 8.0.0
Huawei Y7 (2018) - Android 8.0.0
Sub Activity_Create(FirstTime As Boolean)
Dim Bitmap1 As Bitmap
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE) ' Implicit read capability if granted
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
Log($"PERMISSION_WRITE_EXTERNAL_STORAGE = ${Result}"$)
Activity.LoadLayout("Layout1")
Bitmap1.Initialize(File.DirRootExternal, "Download/OS Search Map.jpg")
ImageView1.Bitmap = Bitmap1
End Sub
android:targetSdkVersion="13"
When the target image is a 4000 x 4000 pixel image both devices display it properly
When the target image is a 8000 x 8000 pixel image both devices display it properly
When the target image is a 10000 x 10000 pixel image both devices display it properly
android:targetSdkVersion="26"
When the target image is a 4000 x 4000 pixel image both device display it properly
When the target image is a 8000 x 8000 pixel image the Huawei fails to display it with no message in the log (which is what I've been seeing before) but the Samsung crashes with a Canvas out of memory error.
This is a massive difference in behaviour from just changing a single value in the manifest. I'm getting Deja Vu as to why I abandoned Android in disgust previously. I'm also getting problems with ExternalStorage failing to remember its permissions and now asking every time - but that's for another time!