ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEFolderTree and IEFolderMView issues with devices
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
241 Posts

Posted - Oct 17 2022 :  15:49:39  Show Profile  Reply


attach/jrpcguru/20221017153651_File Manager Demo with Devices from jrpcguru.zip
1185.07 KB

I have updated this demo and tested with multiple devices. I'm using D10.3.1 and ImageEn 11.4.0 which is a considerable improvement, but still not fully working with devices.

Android 11 Motorola Moto G Power XT2117-4 mount device, then run program:
drive panel and folder panel did update. device selected > SD card selected > crash or hang. Same if I select SD card from drive panel or folder panel
However, if I select the folder entirely within the drive panel, it works.
run program, then mount device:
drive panel is not updated. Folder panel is.
device selected from folder panel > internal shared storage > it worked.
device selected from drive panel after F5 > SD card > crash
If I disconnect device, folder panel clears. drive panel does not update. F5 refreshes the drive panel correctly
mount device, then run program. Show Devices > Select Device > SD Card > it worked
----------------------------------------------------------------------
Android 9 Motorola Moto X4 mount device, then run program: Show devices > device selected > internal shared storage > worked as expected to select folders and files and preview them.
If I disconnect device, folder panel clears. drive panel does not update. Refresh button refreshes the drive panel correctly but fails to update the drive panel even after I added IEFolderTree1.Refresh; I also added IEFolderTree1.autorefresh := true; but it still did not refresh. F5 did refresh the drive panel after I added IEFolderTree1.EnableKeyboardShortcuts := true;

mount device, then run program: Show Devices > device selected > SD card selected > worked as expected to select folders and files and preview them
mount device, then run program: select folders entirely from Drive panel, it works
mount device, then run program. Select device from folder panel > internal storage selected > crash
mount device, then run program. Select device from folder panel > SD card selected > crash

run program, then mount device. Folder panel does show device. Drive panel does not. Refresh button does not show device in drive panel. F5 did refresh drive panel. Select This PC in drive folder. Select device from folder panel > SD card selected > crash
run program, then mount device. Select device from folder panel > SD card selected > works properly.
run program, then mount device. Select device from folder panel > internal storage selected > works properly.
--------------------------------------------------------------------
iOS 15 iPhone 13
device selected via drive panel > shows: WPD:Apple iPhone, try to open Internal Storage via drive panel and select DCIM and individual folders. edtFolder shows: WPD:Apple iPhone\Internal Storage\DCIM\202210_a. Every folder is empty.
OR: device selected by folder panel. WPD:Apple iPhone. double click Internal Storage > crash.

iPhone 13. If I run the program and then connect the device, iPhone fails to show in drive panel, but does show in IEF_DRIVES_FOLDER. It won't go beyond WPD:Apple iPhone\Internal Storage\
F5 in the drive panel does show the iPhone. I can select a folder and edtFolder = WPD:Apple iPhone\Internal Storage\DCIM\202210__, but no files are displayed.
Windows show the files and folders.
-----------------------------------------------------
Android 11 Motorola Moto G Power (different phone)
connect device then run program
device shows in both panels - it operates as expected, navigate folders and show photos.
run program, then connect device
device does not show in drive panel. Otherwise it operates as expected, navigate folders and show photos.
-------------------------------------------------

I can imagine that this is very frustrating since the program seems to act differently with different phones. Since Windows works with these phones, I'm hoping ImageEn can too. The Moto X4 is my phone so I can test it the most. The others were available on vacation with family from around the country.


J.R.

xequte

37479 Posts

Posted - Oct 17 2022 :  21:27:49  Show Profile  Reply
Hi JR

Unfortunately I cannot reproduce any of that on the devices we have here (All Android, Samsungs, OneNotes, etc). So it makes it very hard to determine what the issue might be. When you say "Crash", what do you mean? Is that freeze or some error?

You should step through the ImageEn code to see if you can determine where it is failing.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jrpcguru

USA
241 Posts

Posted - Oct 18 2022 :  08:17:13  Show Profile  Reply
By crash, I mean that the program pauses after I double click the icon for the SD card or the internal storage. It then shuts down. No error message. Sometimes there is a warbling noise, but I have my volume fairly low, so it may happen more than I realize.

I will try to step through your code. At least my Moto X4 is reliable about doing this!



J.R.
Go to Top of Page

jrpcguru

USA
241 Posts

Posted - Nov 08 2022 :  13:11:30  Show Profile  Reply
I tried another device:
Nexus 5X Android 8.1.0 no microSD card
mount device, then run program
Show Devices >double click the device > select internal > works as expected
run program > select device from IEFolderTree > select internal in IEFolderMView1 > crash after long wait
run program > select device from IEFolderMView1 > select internal in IEFolderMView1 > crash after long wait
When it crashes, it just silently goes away.

I couldn't find a way to step into your source code. Anything I tried just turned green and X'd out the debug point.





I have attached the error messages that result when I'm trying to step through the code.

Perhaps you could email instructions on how to step through your code?

J.R.
Go to Top of Page

xequte

37479 Posts

Posted - Nov 10 2022 :  14:43:23  Show Profile  Reply
Hi JR

To step into the ImageEn code, ensure that the ImageEn source folder is on your Delphi source path. Add some erroneous text to ensure that it breaks when you compile it (to check that the source code is being used). Then recompile your project.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jrpcguru

USA
241 Posts

Posted - Jan 07 2023 :  19:13:09  Show Profile  Reply
I have been diverted from this issue for some time but I finally managed to try again. I still haven't stepped through your code enough to have any idea of where the problem is. But I had an idea that might be helpful.

In June 2022 I purchased an Android MP3 player:
https://www.amazon.com/gp/product/B08Q7HZMSY/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I tested it and found useful results that you might be able to replicate with the Portable Device Browser demo. Wouldn't you know, it is no longer avaiable. But this seems to be very similar: : https://g-mee.com/product/g-mee-play/
These devices are cheap enough so you might find it useful to get one for your collection of test devices.

I am now using Win 11, D10.3, and ImageEn 11.4.5

G-Mee1 MP3 Player
Android 8.1.0
Select MTP Media Device - no device recognized - File Explorer succeeded.
Enable USB Virtual Drive- no device recognized
Select Camera - PTP - device recognized. But there is no camera and no photos. Just shows empty photo folders.
Used Copy to Device for 2 .JPG files. the extension was removed in the display and it would not view the files. The extension is present in File Explorer.
DefaultBottomText = iedtFilename so apparently iedtFileName is not giving the correct info.
Switch from PTP to MPT Media Device while showing root folders and it shows all folders.
Switch from PTP to MPT Media Device while showing other folders and it now shows all folders. Still can't preview the .JPG files.
Switch from PTP to MPT and it lost its connection. I was at the Show Devices view.

In my own program and probably the modified demo that sent you before:

File Manager: Select MTP Media Device. The device shows in IEFolderTree when I turned on showing devices.
If I select the device from IEFolderMView, it works as expected.
If I select the device from TIEFolderTree it displays Internal shared storage and SanDisk SD card. Select either one of those folders and it crashes. It shows hourglass for a few seconds and shuts down w/o any error message.

My program successfully previews the .JPG files and .PDF file that I copied onto the device. It displays the file name without an extension, but uses this code to get the file name to preview:
IDx := IEFolderMView.ImageID[ IEFolderMView.SelectedImage ];

sFileName := IEFolderMView.PortableDevices.Objects[idx].Filename

In the demo: UpdateImagePreview

if ( not chkPreview.Checked ) or
( IEFolderMView1.SelectedFilename = '' ) or
( IsKnownFormat( IEFolderMView1.SelectedFilename ) = False ) then
this fails to preview the image.

if ( not chkPreview.Checked ) or
( IEFolderMView1.SelectedFilename = '' ) then
Now the demo will preview the image, even without the correct file extension.

I hope to make more progress on stepping through your code, next week.




J.R.
Go to Top of Page

jrpcguru

USA
241 Posts

Posted - Jan 12 2023 :  18:54:22  Show Profile  Reply
Okay, I finally had time to try to step through your code.
I have attached the modified demo program that I previously sent you that includes the Folder Tree. I've also included in that zip file a slightly modified source file: "modified by JR - iexFolderTree.pas".

G-Mee1 MP3 Player
Android 8.1.0
already connected as File Transfer.

When I run the program, the G-Mee1 appears in the Folder Tree and does not appear in the file panel, regardless of whether I click the Show Devices button.

If I click G-mee1 in the Folder Tree, the file panel displays two available folders.
If I double click one of the folders, there is a short pause with the hourglass and the program shuts down silently.

The problem seems to be in TIEFolderNode.UpdateIcon();
After 514 loops through this procedure, the line:

SHGetFileInfo( Pointer( AbsoluteIDL ), SFGAO_SHARE, FileInfo, SizeOf( FileInfo ), SHGFI_PIDL or SHGFI_SYSICONINDEX );

fails with the error messages that I've included in the "2022-11-08 debug messages fro WPDBrowser demo.JPG" image file. The current failure messages have slightly different memory addresses but the verbiage is the same.

Hopefully this will help you find and fix this problem. But that still leaves the question of why the folder panel does not recognize an attached device that is attached for File Transfer.

If I attach the phone for Photo Transfer, the program displays the g-mee in the Folder Tree and when I click on the g-mee, the file panel shows the two folders. Double clicking on either folder causes the same crash of the program.

If I attach the phone for Photo Transfer, the program displays the g-mee in the Folder Tree. If I click Show Devices, it displays the folders in the file panel and now allows navigating the folders, but, of course, only shows photo folders.

If I have the device folders displayed in Photo Transfer mode and change to File Transfer, the folders remain displayed. And now the folders operate properly and I can navigate among the folders. Though it gives me an error message "The device has either stopped responding or has been disconnected". .JPG files are still showing just the file name without extension and do not preview.


attach/jrpcguru/2023112183054_File Manager Demo with Devices from jrpcguru 02.zip
3280.53 KB

J.R.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: