Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Human readable and reliable path to an android subfolder ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Asger Joergensen

Posts: 370
Registered: 11/18/08
Human readable and reliable path to an android subfolder ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 8, 2016 4:23 PM
Hi

I'm trying to get an reliable pat to a subfolder on an Android phone connected to the PC through USB.

If I browse to the folder using the explorer i get this path:
Computer\A1010a20\PhoneMemory\MyFolder

but if I try to use that path to get to the folder in my code it fails with exception: "file not found".

I'm using:
LPSHELLFOLDER FIDesktopFolder;
SHGetDesktopFolder( &FIDesktopFolder );
 
OleCheck( FIDesktopFolder->ParseDisplayName( Handle, NULL, Value.c_str(), &NumChars, &NewPIDL, &Flags));


If I use my ovn file browser that uses GetDisplayNameOf I get this path:

::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_17ef&pid_7a30&mi_00#6&89fc4b0&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\
SID-{10001,,4473036800}{00000027-0001-0001-0000-000000000000}

And that path works with the code above, the problem is that this pidl path changes, if the folder on the
phone is deleted and recreated with the same name as original and I believe the pidl path could also
very well change, if the phone was replaced with another phone of the same model.

Anyone got any suggestions ??

P.s. If I paste the readable path into another explorer folder it of course finds the location on
the phone without problems.
It can even find it with only this part of the path: A1010a20\PhoneMemory\MyFolder

I'm using win 7 64 bit

Thanks in advance
Best regards
Asger

Edited by: Asger Joergensen on Nov 9, 2016 1:23 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02