10

I have developed a small application that copies files from a folder to another.I use a JFileChooser to select the target directory.Something I hadn't tried for a long time is to select my phone as the target directory.I tried but I couldn't find it from my JFileChooser. I read some other so questions and I was wondering if there is that will allow me to copy files from my pc to an mtp device? I am targeting linux and windows platforms.

My phone is LG Nexus 5 android 6.0.1.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
cssGEEK
  • 994
  • 2
  • 15
  • 38
  • Usually you can choose how your android phone connects via usb. You should use "USB Mass storage"-mode instead of mtp, then you should "see" your phone. – HectorLector Aug 29 '16 at 16:07
  • 1
    since i think honeycomb this option is not available – cssGEEK Aug 29 '16 at 16:08
  • 2
    If there is an answer for your question it will most likely be OS specific. Therefore you should mention what OS you are targeting. BTW: You should not ask for a library (questions for libraries are often closed), better as "is there a way/how to...". – Robert Sep 10 '16 at 20:32

1 Answers1

2

In modern Android releases, USB Mass Storage has been disabled. You can try to enable USB Debugging (in Developer Options) and see if it helps. I've tried it successfully on Windows 10 with a LG G3 Android 5.0

sabuha
  • 17
  • 3
  • The program I developed is for normal user who have no idea how to do this.I have also tried it in windows 8 and it won't work – cssGEEK Sep 18 '16 at 09:44
  • There is a library called [JMTP](https://code.google.com/archive/p/jmtp/), to access MTP devices from Java. Having never used it, I can't say if it will answer your problem, but it may worth a try. – sabuha Sep 18 '16 at 12:31