B4J Question Copy File From Phone (USB Cable) To Desktop Using B4J Code

I have tried to search for a solution, but can't find it

Does anyone know what is the FILEPATH of the Phone's Internal Storage - when connected to the Desktop?

I want to Copy files from the Phone to Desktop - using B4J Code

Like this example:

B4J:
File.Copy(Phone's FilePath of Internal Storage, "x.jpg", "C:\Users\Hp\Desktop\Pictures", "x.jpg)

It shows in the Desktop's Windows Explorer - but what is the FilePath to use for Coding?

Please can someone help me

Thank you so much 🙂
 
Jahswant, thank you for the reply

I try FTP

But is there NO WAY to get the Phone's FilePath to use in B4J Code?

It's sittin' there in Windows Explorer – so I reckon there has to be a FilePath – I'm guessin'
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The phone isn't connected to the PC as an external storage. It uses a protocol named MTP which is difficult to work with directly.

As written above, you can build a good solution over the local network. Another interesting option is based on ADB. With ADB you can create a TCP/IP connection and also use ADB with Shell to copy files.
 
Upvote 0
Hi Erel and jahswant,

How about this solution?

Phone connected to Dual Drive USB Type-C - as External Storage - which is connected to Desktop.

So B4A copies with Code to Dual Drive USB Type-C - then B4J on Desktop can read from this Drive - cause it has a Drive Letter and FilePath.

Have to get the Dual Drive USB Type-C device tomorrow and try it.

You guys think it can work?

Let you know.

Thank you
 
Upvote 0
Top