4

Actually i have an android app that send some data via FTP, now i should add the possibility of passing that data even via USB if there is no available network.

So i'm going to use getExternalStorageDirectory method to do this but before i would check if the device is connected via USB so i'd display just in this case the button to load data to the PC. How could i check if the device is connected to a PC?

NiceToMytyuk
  • 3,644
  • 3
  • 39
  • 100
  • 1
    Maybe here you can find a discussion about your problem https://stackoverflow.com/questions/4600896/android-detecting-usb – user1746397 Aug 05 '19 at 13:02
  • 1
    I just made a quick search, take a look here: https://stackoverflow.com/questions/30182172/android-how-to-detect-already-connected-usb-device – Igor Romcy Aug 05 '19 at 14:10

0 Answers0