Write information in USB (Android )



  • Hi! I took a simple Hello World and tried to create a txt file in a usb device connected via OTG cable. I tried this application in Linux and it works fine but on Android I cannot write in the desire location.
    Since I must connect OTG to use my pendrive, I cannot debug my application, so my question is: how can I read and write information in an USB drive in Android? Also, how can I detect that a pendrive was plugged?

    I added READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions but no success neither :/
    The path that I think that belongs to my usb drive is /storage/usbdisk. Is this a standard for all devices?

    I based my Hello World in this info: http://doc.qt.io/qt-5/qstorageinfo.html#details

    PS: I'm targeting Android-19 but using devices that run Android-21 and Android-23, is this important for this case?

    Thanks,
    Fernando


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.