0

I'm writing a simple Java app using Android Studio to save some text data to a file on the phone.I want to make an Export button that will copy the file to the PC when I connect via USB.

I have an app on my phone called My Files and it can see networked shared folders on the PC when connected via USB. So I think there may be a way to copy a file from the phone to that network folder, but I can't find any information that helps me figure out how to do it.

I'm mostly a database programmer, So any help on this would be appreciated. I think my main confusion is how to tell Java where to write the file. The only way the network location appears on the phone is equivalent to \\PC_NAME\SHARE_NAME.

Nabzi
  • 1,823
  • 1
  • 16
  • 26
DougCLind
  • 11
  • 4
  • I believe Samsung's My Files app is using your local wifi network to find the network shared folders. Such a feature is **not** part of the Android framework and requires custom code/third-party libraries. See: [How to access share folder in windows through android and read files](https://stackoverflow.com/q/9389366/295004) – Morrison Chang Jun 27 '20 at 08:27
  • You're absolutely right Morrison. Thanks much. I unplugged the USB, rebooted the phone and the My Files thing was still showing the network shares. Very frustratingly complicated for someone who's used to being able to copy files with something like "copy file to ". Pushing data around is a lot of what I do so having to worry about HOW to do it is ... irritating. We live in an imperfect world. – DougCLind Jun 28 '20 at 00:00
  • I may wind up either figuring out how to do a Bluetooth transfer or else writing code on the PC side to suck the file over instead of pushing from the phone to the PC. – DougCLind Jun 28 '20 at 00:02

0 Answers0