This is a companion question related to this issue:
Delphi - New apps on Google Play must target Android 8 (API level 26) - PUSH notification in background
I am trying to save a bitmap to a "clientName" sub-folder under Android's picture folder.
If I use the original AndroidManifest.template.xml file, everything works as expected. If I use an AndroidManifest.template.xml file patched with 'targetSdkVersion="26"' to meet google's deadline for acceptance into the app store, the same code fails (raises an exception on ".SaveToFile").
Is there any way to get around this issue while Embarcadero works it out internally?
This is the code :
BaseFolder := System.IOUtils.TPath.GetSharedPicturesPath;
If DirectoryExists(BaseFolder) = True then
Begin
SaveFolder := BaseFolder+System.IOUtils.TPath.DirectorySeparatorChar+clientName;
If DirectoryExists(SaveFolder) = False then ForceDirectories(SaveFolder);
SaveFile := SaveFolder+System.IOUtils.TPath.DirectorySeparatorChar+clientName+'_'+ReplaceStr(ReplaceStr(DateTimeToStr(Now),':','.'),'/','.')+saveImageFileExt;
Try
bmpCropped.SaveToFile(SaveFile);
Except
displayMessage := strErrorSavingPicture;
End;
If FileExists(SaveFile) = True then displayMessage := strPictureSaved;
End
Else displayMessage := strPictureFolderNotFound;