If I save a TBitmap as jpg into the public picture folder, the file will not show up in picture viewer.
Also it is not shown in the windows explorer which is connected via USB cable to the android device.
The file is created as expected into the android device.
Using a file explorer I can see the file and can open it manually: The file content seems to be correct.
The strange thing:
After I rename or copy the file using a android file explorer the file shows up immediately in the picture viewer and also in the external windows explorer.
So it seems the way delphi create the file on the device is somehow not the way android expext it.
The sample source code of this problem is quite simple:
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Objects;
TfmTest = class(TForm)
procedure FormCreate(Sender: TObject);
procedure TfmTest.FormCreate(Sender: TObject);
// create sample bmp
xBmp := TBitmap.Create(100, 100);
xBmp.Canvas.Fill.Color := TAlphaColorRec.Khaki;
xBmp.Canvas.FillEllipse(TRectF.Create(0, 0, 99, 99),1);
// save this bmp to puclic pictures
sFn := TPath.Combine(TPath.GetSharedPicturesPath, ‘test.jpg’);
It does not matter which file explorer I take (e.g. ES File Explorer
or File Commander)
I tried different directories to create the file
in. Allways the same. If I create also the directory the content is
not shown unless I rename the directory with a file explorer.
Used Delphi Version: XE6 on Win7-64, used Android: 4.4.4 on Sony Xperia Z2