access mtp device with java
Asked Answered
D

1

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.

Declassify answered 29/8, 2016 at 16:2 Comment(3)
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.Cacilia
since i think honeycomb this option is not availableDeclassify
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...".Enfeoff
M
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

Mcabee answered 17/9, 2016 at 18:56 Comment(2)
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 workDeclassify
There is a library called 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.Mcabee

© 2022 - 2024 — McMap. All rights reserved.