Sending files to PC via USB

Hi,
Is there an extension to transfer files from phones to PC via USB?
For example, in extension I give the path to the file or folder from the phone to be transferred on PC, and path to the folder on the PC where the files are to be uploaded from phone.

Hello Damian

Well, most phones deliver this capability via a PC based executable "ADB.exe" (Android Debug Bridge) , supplied by Google.

the point is that i wants to select a folder or file in the application by specifying the paths and transfer them to the PC in the designated place, without the need to open and search folders from the computer.
that is, just. I choose "this" I click "send data" and everything is automatically sent to the designated place in PC storage

Right. Not as simple as it sounds because Google recently introduced security measures that prevent Apps from accessing most of the phone's folders - will the files you wish to transfer be stored in the App's own folder (Application Specific Directory)?

Rather than use the adb bridge, you will need another method of sending the files. I think the new App Inventor Serial Library may suite the requirement. The PC would need to be preset with a target folder that has "shared" status.

Taifun's File Extension may be required:
https://puravidaapps.com/file.php

I have a taifun file extension.
Currently app create a folder after taking a photo for which a special filename is given.
For example path: storage/emulated/0/SampleAppFolder/SAMPLE_NAME_PHOTO_20201002.jpg
what's next? where to start, and how? :slight_smile: )

Hello Damian

I have been looking at App Inventor's Serial Lib and it's really aimed at sending small data packets to microcontrollers (like Arduino). I can give you a rough idea of how it might work with a PC, but I think it actually requires a sister program on the PC to receive the data.

So what I had in mind:
Phone App

  1. Convert the photo into a B64 string
  2. Send the B64 string via the WriteSerial data Block (may have to split the string into chunks and send using a loop)

PC App

  1. Define a serial Port e.g. 'COM1'
  2. Open (initialise) the Port.
  3. Read the Serial Port data (B64 String)
  4. Convert the B64 String back into a photo (image)
  5. Save the file to a predefined folder (directory)

That sounds like a lot of work and it is. You also need to be able to program in another language (that understands ports) such as C++ or Java (or one of my favourites, PureBasic).

So that's my thoughts involving a USB cable but of course there are other Comms to explore as well, for instance Windows10 should be able to receive files via Bluetooth, most PCs can support WiFi.