I have wrote an android app named “raiden memories backup” client/server with Delphi 10.4 to build home photo server.
My site is : https://www.raidenmemoriesbackup.com
Google Play store: search “raiden memories backup”
The app works fine on android 10/11 until I got a new phone with android 12. I found the app will cause “no responding” issue when I get into path “DCIM/CAMERA” which has 3xxx files. It won’t happen at first time, but it surely happen after entering this folder several times, but it is not freezed actually and I can click [wait] button then continue the operation and it will popup again few seconds later (looping). I have no idea what happened. I think my code is quite simple.
Below is my code steps:
ListView1.BeginUpdate; ListView1.items.Clear; folders := TDirectory.GetDirectories(path_tr); AddListItem(folders, 'folder'); files := TDirectory.GetFiles(path_tr); AddListItem(files, 'file'); ListView1.EndUpdate;
then part of AddListItem procedure is below:
for c := 0 to length(list) - 1 do begin //xx application.ProcessMessages; if stopadditem then break; Litem2 := Listview1.Items.Add; if itype = 'folder' then begin LItem2.ImageIndex := 2; LItem2.Text := ExtractFileName(list[c]); LItem2.Detail := list[c]; LItem2.TagString := list[c]; LItem2.Tag := 0; end else begin LItem2.ImageIndex := 3; LItem2.Text := ExtractFileName(list[c]); LItem2.Detail := FormatDateTime('yyyy-MM-dd hh:mm:ss', TFile.GetLastWriteTime(list[c])); LItem2.TagString := list[c]; LItem2.Tag := 1; end;
I haven’t test it under Delphi 11.3 yet. Just wanna know is it an issue about TListview with large files in android12 ? May anyone give me some advices? Appreciate for any help. Thanks.