Programmatically write to an Android device

I would like to write a Java program that copies mp3 files from my computer, renames them so that they are sorted correctly, and transfers them to the SD card on my Android phone via USB. I suggested that this would be a trivial task, since I had already successfully written a similar program for transferring files to an external hard drive, however, I immediately came across a stumbling block. It seems that java (and other desktop applications) cannot find the device’s file system, even if the exact path given by Windows Explorer (this computer \ SAMSUNG-SM-G900V \ Card) is specified.

I tried to investigate, and the problem seems to be related to the fact that the device is considered a portable device, not a drive (maybe), but I did not find a specific solution. The answer to the next question seems to suggest that this is impossible, but it’s hard for me to believe it.

Is it possible to map the internal memory of Android to drive letter on PC?

Does anyone know a way to access portable device storage through Java? If this is really not possible, can someone help me understand why this is possible through Windows Explorer and not through other programs.

+4
source share

Source: https://habr.com/ru/post/1626927/


All Articles